Search Results

Search: Posts Made By: injey
8,680
Posted By injey
Thanks guys. printf worked.
Thanks guys. printf worked.
8,680
Posted By injey
how to create flat file delimited by "\002"
I need to create a flat file with columns delimited by "\002" (octal 2)

I tried using the simple echo.


name="Adam Smith"
age=40
address="1 main st"
city="New York"
echo...
14,600
Posted By injey
Yep. that did the job. Thanks for figuring it...
Yep. that did the job. Thanks for figuring it out.


awk 'BEGIN {FS=sprintf("%c",2)} {print $2}' sample
14,600
Posted By injey
Chubler - I just tried the sprintf idea. It is...
Chubler - I just tried the sprintf idea. It is not working too. somehow it is not recognizing \002 or 0x02 representation.

I even tried to print 0x02 into a file using below. the file does not...
14,600
Posted By injey
Thanks. I am able to do it using Scrutinizer's...
Thanks. I am able to do it using Scrutinizer's first trick.

awk -F^B '{print $2}' infile

The second method using \002 did not work though.

Chuber_XL - Thanks. sprintf seems a brilliant...
14,600
Posted By injey
Read columns from delimited file in UNIX
Hello
I need to read the columns from a flat file delimited by Hex code X02.

The Sample file is
Red^B1000^BJohn
Blue^B2000^BSam
Green^B3000^BDan

Note: Hex code X02 shows as ^B in vi.
...
Showing results 1 to 6 of 6

 
All times are GMT -4. The time now is 11:33 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy