Search Results

Search: Posts Made By: c2b2
19,070
Posted By c2b2
Try system()...though i am not sure how exactly...
Try system()...though i am not sure how exactly to do it!
5,253
Posted By c2b2
awk '{ printf "\"%s\"\n", $0 }'...
awk '{ printf "\"%s\"\n", $0 }' file
1,937
Posted By c2b2
awk ' { print "%s,%s,%s", substr($0,1,5), substr...
awk ' { print "%s,%s,%s", substr($0,1,5), substr ($0,6,10), substr($0,11,7) }' inputfile > outputfile
4,283
Posted By c2b2
Try this if you have a very big file (say 100k...
Try this if you have a very big file (say 100k records)

cut -c1-9 file > tempfile1
cut -c10-15 file | tr -cd "\n" "X" > tempfile2
cut -c15- file > tempfile3

paste -d"" tempfile1 tempfile2...
4
syn
1,920
Posted By c2b2
You ca even go for Awk, it can give you more...
You ca even go for Awk, it can give you more control over fields!!
28,851
Posted By c2b2
R u sure BOFH? Check...
R u sure BOFH?

Check http://unix.com/showthread.php?t=35510 for answer
1,868
Posted By c2b2
I guess we can doit by: 1. shift for multiples...
I guess we can doit by:
1. shift for multiples of ten
or
2. Assign the arguments' list ($*) and using cut (though might fail in few cases)

Any better alternatives UNIX gurus?
1,868
Posted By c2b2
Thank You! :)
Thank You! :)
1,868
Posted By c2b2
Dynamic Agrument while running a script
Hi Gurus,

I am tryin to get the nth argument/parameter ( n being calculated in runtime).
I want to assign tghis value to a variable say myvar. How do i do it? I am struggling to get proper escape...
5,646
Posted By c2b2
Wil all lines in a file have same number of...
Wil all lines in a file have same number of columns?
1,755
Posted By c2b2
Check man pages for test...
Check man pages for test...
4,536
Posted By c2b2
Hi Every1, Is there othr way to do the same,...
Hi Every1,

Is there othr way to do the same, because awk will traverse each line and might become slow in case of very huge input file.

Correct me if I am wrong!
15,876
Posted By c2b2
Thank You
Hey Thank you anbu :)

But I have two question? :confused:
Can you please clearify them.

1. I thought only single slash is required for escaping, then whats the meaning of double slash.

2....
15,876
Posted By c2b2
Only awk is working fine. However, while...
Only awk is working fine. However, while assigning the same to variable, it is not working.

My Sample Inputfile is as shown below:

MyAdd1 MyAdd2 ...
15,876
Posted By c2b2
It is a variable.
It is a variable.
15,876
Posted By c2b2
Assign o/p of awk to a variable
:confused: Hi UNIX gurus,

I am facing a typical problem while assigining while assigining output of awk to a variable.

I have a fixed length file say myinputfile.txt

When I allow the...
2,431
Posted By c2b2
Assigining output of Awk to a Variable
Hi UNIX gurus,

I am facing a typical problem while assigining while assigining output of awk to a variable.

I have a fixed length file say myinputfile.txt

When I allow the value/output of an...
8,338
Posted By c2b2
What distinguishes Header and data? Is there a...
What distinguishes Header and data? Is there a fixed list of Headers or was the input file generated after pasting your several hundred files? Can you explain the exact requirements?
6,742
Posted By c2b2
Use: tr -cd "0123456789"
Use:

tr -cd "0123456789"
17,637
Posted By c2b2
Thnks 4 ur suggestion. Iwil convert it into a...
Thnks 4 ur suggestion.
Iwil convert it into a csv.
17,637
Posted By c2b2
There are going to be a lot of manipulations only...
There are going to be a lot of manipulations only if couple of fields' values.

Now if the file was a delimited, i could have written something like

awk '$2=something && $3=somthingelse { some...
17,637
Posted By c2b2
Say the file format is like: Record length:...
Say the file format is like:

Record length: 1-30

Fields 1-10 > Emp ID
Fields 11-20 > Emp Name
Fields 21-30 > Contact No

I want 2 perform some awk operations.
Is there any option like -F...
17,637
Posted By c2b2
Awk with fixed length files
Hi Unix Champs,

I want to awk on a fixed length file.
Instead if the file was a delimited file, then I could have used -F and then could have easily done manipulation on the fields.
How do i do...
5,170
Posted By c2b2
I meant use Sed or perl to replace that Single...
I meant use Sed or perl to replace that Single tab by Multiple tabs.

Do let me kno if it dosnt wrk.
10,698
Posted By c2b2
Hey m not trying 2 cross ne1.... m jus askin...
Hey m not trying 2 cross ne1....

m jus askin 4 knowledge....wont this hav performance issue as compared to cut?

Which one is betr...i had a similar thing done for 150k records, so wud prefer...
Showing results 1 to 25 of 29

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