Replacing field from file 1 with field from file 2


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Replacing field from file 1 with field from file 2
# 8  
Old 04-25-2011
Quite embarassingly, I'm trying to convert what you wrote into the true file i'm working with which has over 130 fields.

But trying with your sample it returns 4 blank lines.

I think I got it though,

thanks very much for the informative answer.

---------- Post updated at 04:46 PM ---------- Previous update was at 04:35 PM ----------

Got it, stupidity of my part.

Just needed a cup of joe to see the light.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Replacing field based on the value of other field

Hi Team, In the below input file, if I have the value 23,24,25 then for those records 1st field value should get updated from "a" to "b". I also want to pass these values in file as input as it can be done dynamically. Tried awk commands but not getting desired output.Using SunOS 5.10 version.... (14 Replies)
Discussion started by: weknowd
14 Replies

2. Shell Programming and Scripting

Command/script to match a field and print the next field of each line in a file.

Hello, I have a text file in the below format: Source Destination State Lag Status CQA02W2K12pl:D:\CAQA ... (10 Replies)
Discussion started by: pocodot
10 Replies

3. Shell Programming and Scripting

Replacing nth field with nth_text for each line in a file

Hi All, I am very new to shell scripting and tried to search this in the forum but no luck. Requirment: I have an input file which is comma separated. I need to replace the value in 4th column with another value. This has to happen for all the lines in the file. Sample data: Input... (2 Replies)
Discussion started by: arunkumarsd
2 Replies

4. Linux

How do I format a Date field of a .CSV file with multiple commas in a string field?

I have a .CSV file (file.csv) whose data are all enclosed in double quotes. Sample format of the file is as below: column1,column2,column3,column4,column5,column6, column7, Column8, Column9, Column10 "12","B000QRIGJ4","4432","string with quotes, and with a comma, and colon: in... (3 Replies)
Discussion started by: dhruuv369
3 Replies

5. Shell Programming and Scripting

Plz Help. Compare 2 files field by field and get the output in another file.

Hi Freinds, I have 2 files . one is source.txt and second one is target.txt. I want to keep source.txt as baseline and compare target.txt. please find the data in 2 files and Expected output. Source.txt 1|HYD|NAG|TRA|34.5|1234 2|CHE|ESW|DES|36.5|134 3|BAN|MEH|TRA|33.5|234... (5 Replies)
Discussion started by: i150371485
5 Replies

6. Shell Programming and Scripting

Compare two files Field by field and output the result in another file

Hi Friends, Need Help. I have file1.txt as File1.txt |123|A|7267|Hyder|Cross|Sell|7801 |995|A|7051|2008|Lunar|New|Year|Promotion|7801 |996|A|7022|Q108|Targ|Prospect|&|SSCC|Savings|Promo|7801 |997|A|7182|Q1|Feb-Apr|08|Credit|ITA|PA|SBA|Campaign|7801 File2.txt... (7 Replies)
Discussion started by: i150371485
7 Replies

7. Shell Programming and Scripting

Append 1st field from a file into 2nd field of another file

Hi, I've internally searched through forums for about 2+ hours. Unfortunately, with no luck. Although I've found some cases close to mine below, but didn't help so much. Actually, I'm in short with time. So I had to post my case. Hoping that you can help. I have 2 files, FILE1 ... (1 Reply)
Discussion started by: amurib
1 Replies

8. Shell Programming and Scripting

Appending 1st field in a file into 2nd field in another file

Hi, I've internally searched through forums for about 2+ hours. Unfortunately, with no luck. Although I've found some cases close to mine below, but didn't help so much. Actually, I'm in short with time. So I had to post my case. Hoping that you can help. I have 2 files, FILE1 ... (0 Replies)
Discussion started by: amurib
0 Replies

9. Shell Programming and Scripting

replacing field in specific line in a file

Hi, I know there are lots of threads on replacing text within files, usually using sed or awk. However, I find it hard to adapt examples that I found to my specific case. I am kind of new to UNIX and have hard times learning the syntax either for sed or awk so I would appreciate any help. Here's... (5 Replies)
Discussion started by: vytenis
5 Replies

10. UNIX for Dummies Questions & Answers

Replacing a field in pipe delimited TEXT File

Hi, I want to replace a field in a text delimited file with the actual number of records in the same file. HDR|ABCD|10-13-2008 to 10-19-2008.txt|10-19-2008|XYZ DTL|0|5464-1|0|02-02-2008|02-03-2008||||F||||||||| DTL|1|5464-1|1|02-02-2008|02-03-2008|1||JJJ... (3 Replies)
Discussion started by: ravi0435
3 Replies
Login or Register to Ask a Question
RIG(6)								   Games Manual 							    RIG(6)

NAME
RIG - Random Identity Generator USAGE
rig [ -f | -m ] [ -d datadir ] [ -c num ] DESCRIPTION
Rig is a utility that will piece together a random first name, last name, street number and address, along with a geographically consistant (ie, they all match the same area) city, state, ZIP code, and area code. It is suitable for such applications as feeding the NY times registration page to fend off junk (snail) mail and telemarketers, or for reg- istering on BBS's to which you don't wish to reveal your real information. OPTIONS
-f, -m Respectively, use female and male names. If neither or both options are selected, RIG uses both female and male names. -d datadir Use data files found in datadir. Without this option, the default directory of /usr/share/rig is assumed. -c num Output num identities. Default is 1. FILES
/usr/share/rig/locdata.idx /usr/share/rig/street.idx /usr/share/rig/fnames.idx /usr/share/rig/mnames.idx /usr/share/rig/lnames.idx HISTORY
Based on "fake" written for MS-DOS. Unfortunately the author and publish date are unknown. First UNIX version written from scratch in 1999. This manpage based on RIG version 1.10. AUTHORS
UNIX version (c) 1999-2002 Ian Turner with contributions from Ian Prowell, Nick Rusnov, and Schneelocke. Geography Database is from the original version and I believe it to be held in the public domain. Names database is from the US Census at http://www.census.gov/genealogy/names/ , courtesy of Trent Stanley. Send all comments and bug-reports to: vectro@RIG.sourceforge.net 4 JUN 2002 RIG(6)