All Forums Tools
ANUBHA 6 posts Joined 06/12
28 Jun 2012
How to bypass the valid comma separator during the fastload

I want to load two columns data to the table

 

data:

10021 ,Brown, Jo

10001 ,Jones, Bill

 

i am trying to load this data using FASTLOAD utility and i am defining comma ',' as seperator as below

 

SET RECORD VARTEXT ','

 

Problem: as comma is defined delimitter, the fastload script consider the second column value as Brown instead of Brown, Jo.

 

How to overcome this problem.

 

 

ratchetandclank 37 posts Joined 01/08
28 Jun 2012

The latest version of fastload (well, from TTU 14.0) supports quoted vartext records. You can specify the data as "10021","Brown, Jo".

ANUBHA 6 posts Joined 06/12
28 Jun 2012

Thanks for your reply. But the file i am trying to load has more than 10,000 records and the data is like below

col1 , col2

10021 ,Brown, Jo

10001 ,Jones, Bill

10002 ,Smith, Jim

10028 ,Lee, Sandra

10029 ,Berg, Andy

10023 ,Ayer, John

It is time taking work to keep " through out the file. Is there any other option to read the file as it is and load correctly to the two columns.

CarlosAL 295 posts Joined 04/08
29 Jun 2012

Anubha:

 

10000 records is peanuts.

If I were you, I'd load the file with bteq (more versatile) with some kind of magic with SUBSTR and POSITION/INDEX.

 

HTH

Cheers.

Carlos.

dnoeth 1930 posts Joined 11/04
29 Jun 2012

If it's always "col1,col2,col3" you should keep the VarText, but switch to BTEQ or MLoad.

Then simply define 3 columns and INSERT(col1, col2 || ', ' || col3).

Or load three colums using FastLoad into a stage table and then INSERT/SELECT into target.

And think about if you really want kind of comma delimited data in a single column.

Dieter

ocirej23 9 posts Joined 04/11
29 Jun 2012

Another approach is you can edit the file using awk command in unix.

then after that you can use fastload using the newfile.

Here is a sample command:

 

awk -F "," {'print "\42" $1 "\42" "\," "\42" $2 "\," $3 "\42"'} data.csv > datanew.csv

 

The result would be:

"10021,"brown,jo"

"10001,"jones,bill"

"10002,"smith,jim"

 

HTH

Cheers,
Jerico

 

ANUBHA 6 posts Joined 06/12
29 Jun 2012

Thank you all for workarounds.

ratnamch 14 posts Joined 06/12
01 Jul 2012

could you please,

send me the script of

Q: how to identyfy the every one hour,insert ,update ,deleted records , records count  

plz send me 

ratnamch 14 posts Joined 06/12
01 Jul 2012

could you please send the 

above query script also plz

 

yaragalaramesh 20 posts Joined 06/12
16 Jul 2012

Hi,

 

  can any one help me

  My problem is   i have a data in the file like as

 

sample_data

1,        2,      ram,yaragala,....,....,    ,    ,   ,

2,        3,       nag,gaddam,......,.........,.......,

3,        3,       mahesh,giddaluru,.......,........,

.

.

.

  like this i have data   i need load this data into table by using ',' delemeter  isf i am using ',' it is taking multiple columns but i eed to load that column 3  data into a single column.(here in the file column 3 has multiple  ','  )   can you please help me

 

 

 

 Thanks in advance

 

Ram

ratchetandclank 37 posts Joined 01/08
17 Jul 2012

Are the explanations provided in the above thread not clear enough ?

yaragalaramesh 20 posts Joined 06/12
17 Jul 2012

here in the above prob in the column 3 contains more than 20 delemeters in it's data forexample then if i am using delemeter as ',' then it  is taking single column data into 20 columns i want load this data as single column as it is not in different columns

 

  i.e  source is 3 columns and my target also should be 3 columns only but it is not loding like rthis can any one help me please

 

Ram

yaragalaramesh 20 posts Joined 06/12
17 Jul 2012

 

 

column 3

ram,yaragala,....,....,    ,    ,       

nag,gaddam,......,.........,.......,     

mahesh,giddaluru,.......,........,

 

The above data is belongs to one column so i need to load this data  into single column

Ram

You must sign in to leave a comment.