I'm afraid this problem is not that easy to solve as it seems to come from a data/data entry error in the input file. We need to unambiguously identify the address field. Will records always consist of the same number of fields? Will the e-mail-addresses always be in the records' last field? Will they be the only fields containing a dot, or a common domain or set of domains?
Depending on what OS and sed version you use (which you fail to mention in your post), this might work for the conversion (without solving your problem yet):
Don't you need the header line use the same separators?
I have one flat file like below
id1~col~batch1
id2~col2~batch2
id3~col3~batch3
I need to read the first column one by one and I need to write one db2 query based on that column1
Like
for (i=0;i<=10;i++)
do
insert into table column (con_id) values (select column from table where... (4 Replies)
Hi,
This is how data in test.txt file
| |abc|zxcv|xy12|
| |cvs|zzvc|a23p|
How can remove first column.
abc|zxcv|xy12|
cvs|zzvc|a23p|
Thanks
srimitta (8 Replies)
Hi,
I am new to shell scripting, i have requirement can any one help me out in this regrads,
in directory i have file like invoice1.txt, invoice2.txt in each file i have fixed number of columns, 62 in number but they are randomly arranged.like
for first file invoice1.txt can have columns... (5 Replies)
I have 5 column in sample txt file
where in i have to create report based upon 1,3 and 5 th column..
I have : in first and third coulmn. But I want to retain the colon of fifth coulmn and remove the colon of first column..
5th column contains String message (for example,... (7 Replies)
Hello Gurus,
I need to create a file from a .csv file extracting specific columns only.
File structure is
Column1,Column2,Column3,Column4
abcd,1234,"asdf, tew,123",123456
efgh,234,asdf,654321
My output file should have
abcd,123456
efgh,654321
Can you pls help me with the code.
... (10 Replies)
Hi,
I have a No Delimiter variable length text file with following schema -
Column Name Data length
Firstname 5
Lastname 5
age 3
phoneno1 10
phoneno2 10
phoneno3 10
sample data - ... (16 Replies)
Hi,
Extremely new to Perl scripting, but need a quick fix without using TEXT::CSV
I need to read in a file, pass any delimiter as an argument, and convert it to bar delimited on the output. In addition, enclose fields within double quotes in case of any embedded delimiters.
Any help would... (2 Replies)
I have an input file as below
Emp1|FirstName|MiddleName|LastName|Address|Pincode|PhoneNumber
1234|FirstName1|MiddleName2|LastName3| Add1 || ADD2|123|000000000
Output :
1234|FirstName1|MiddleName2|LastName3| Add1 ,, ADD2|123|000000000
OR
1234,FirstName1,MiddleName2,LastName3, Add1 ||... (2 Replies)