Search Results

Search: Posts Made By: GoldenFire
5,443
Posted By GoldenFire
Thank you vgersh99. I looked into the...
Thank you vgersh99.

I looked into the related threads and I found this code helpful:
awk '{i=$1;sub(i,x);A[i]=A[i]$0} FILENAME==ARGV[ARGC-1]{print i A[i]}' file*

I am newbie.
Could you...
5,443
Posted By GoldenFire
Thank you Chirel. Yes I want to have the lines...
Thank you Chirel.
Yes I want to have the lines that matches on all the files.

The problem is that I have many files (184 files in TXT format). Is this possible to join them without being required...
5,443
Posted By GoldenFire
join files based on a common field
Hi experts,

Would you please help me with this?
I have several files and I need to join the forth field of them based on the common first field.
here's an example...

first file:
280346...
7,254
Posted By GoldenFire
Thank you very much!!! It perfectly works :)
Thank you very much!!!
It perfectly works :)
7,254
Posted By GoldenFire
I'm sorry but my problem is how to add the commas!
I'm sorry but my problem is how to add the commas!
7,254
Posted By GoldenFire
These numbers are actually codes and in this file...
These numbers are actually codes and in this file two characters are reserved for each code which vary between -1 and 99.
7,254
Posted By GoldenFire
insert comma in a text file
Hi all,
I have a text file and I need to insert comma after every 2 digit.
-1-1-1-1-1-1-1-1-1 0 0 0
-1-1-1 2 0 0 3 311-1 0 1
-1-1 021 0 011-1-1 033 0I'd like to have this:...
7,968
Posted By GoldenFire
Thank you very much pravin27 and Scrutinizer. I ...
Thank you very much pravin27 and Scrutinizer. I learned from you :)

I like this one
awk 'NF<17{$0=$0 FS 99999}1' infile
6,747
Posted By GoldenFire
Hi ken002, I am sure that experts will help...
Hi ken002,

I am sure that experts will help you with a nice command, however with my very basic knowledge I would do this:

grep ", ," input file > output file
7,968
Posted By GoldenFire
It's not working for my new file!
Hi all,

I am trying to insert missing value (99999) in the blanks which are always in the last field.
Could someone please kindly tell me why this code awk -F\, '{if($17==""){$17=99999};print...
7,968
Posted By GoldenFire
Thanks so much pravin27 That's great. It's...
Thanks so much pravin27
That's great. It's perfectly working now. :)

I also tested the code by dragon.1431
It's adding the missing values to the end of all rows.
7,968
Posted By GoldenFire
Thank you very much pravin27. It's working...
Thank you very much pravin27.

It's working very well, however it's creating a missing value in the last row too. How can I get ride of this?
999 93848 5354 343 67898
677 45545 3522 244 99999...
7,968
Posted By GoldenFire
Find and replace blank in the last field
Hi all,

I have a huge file and I need to get ride of the fields 6-11 and replace the blanks in field 5 with a missing value(99999).

159,93848,5354,343,67898,45,677,5443,434,5545,45...
2,347
Posted By GoldenFire
Many thanks for your kind help. I edited the...
Many thanks for your kind help.
I edited the files and both codes perfectly worked.
2,347
Posted By GoldenFire
Thank you very much Chubler XL . I tested it...
Thank you very much Chubler XL . I tested it again and I found that your code is working flawlessly and the problem is with my data. Actually, both files are space-delimited but the spacing between...
2,347
Posted By GoldenFire
Chubler_XL and rdcwayx , I can't thank you...
Chubler_XL and rdcwayx ,
I can't thank you enough for your time and help.

My data has no headings and I just put them to make my code clear.
I tried
awk 'NR == FNR { A[$1"|"$2]=$9;...
2,347
Posted By GoldenFire
Comparing two files and inserting new fields
Hi all,

I searched the forum and tried to learn from the similar posts. However, I am new and I need to get help on this. I hope an expert kindly help me to sort this out.

I need to compare...
2,762
Posted By GoldenFire
Thank you very much scottn and rdcwayx for your...
Thank you very much scottn and rdcwayx for your kind helps. Both ways deleted the undesired lines. However, I forgot to mention that my files have some headers which I like to keep them. So the way...
2,762
Posted By GoldenFire
A way to delete specific lines
Hi all,

I hope an expert tells me that there is a way to get ride of the certain lines in my files which have no specific string on them but fixed length.
It's the original pattern:...
2,101
Posted By GoldenFire
ohh! I just searched for the if statement and...
ohh! I just searched for the if statement and didn't pay attention to the shell!
Thanks very much scotten for sorting this out and also the useful links.
2,101
Posted By GoldenFire
Remove the files that have less than certain lines
Hi all,

I'm a newbie and I'm sorry if my question is too simple.
I'm having problem to delete the files that have less than certain lines, say 16.

#!/bin/tcsh
set filen = `sh -c 'ls *csv 2>...
2,640
Posted By GoldenFire
Thank you so very much everybody. All the...
Thank you so very much everybody.

All the codes suggested by ctsgnb are working flawlessly. Great work!

I tested the two codes by danmero and Franklin52 and nothing is changed in my file. I...
2,640
Posted By GoldenFire
Place variables at the beginning of each line
Hello all,

I am very new to the shell scripting and I hope someone can help me with this.
I have thousands of files with certain format of information and I need to do this for all my files.
...
Showing results 1 to 23 of 23

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