Add extra columns help


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Add extra columns help
# 8  
Old 10-11-2011
Adding columns with the "paste" command is so easy, i don't understand why you don't use it in your code, give more clue.
Please provide your input file as well as the whole code you have trouble with.
# 9  
Old 10-11-2011
Quote:
Originally Posted by saggiboy10
Shell Life i appreciate your prompt replies..But am into forums for answers not just anybody can simply write whatever comes to their minds...These are all real time requirements so please reply if only you know the answer...
Saggiboy,

We are here to help, but before we can help, we need to have full and precise description of the issue with a sample of input, code and desired output.

Still after you posted multiple entries here, you failed to provide all details of your issue.

If you are clear from the start, there is no need for questions on your post.

Next time, do not just post without thinking.

Be specific and give full explanation on your issue.

Read it several times and ask yourself if there could be questions about it.
This User Gave Thanks to Shell_Life For This Post:
# 10  
Old 10-11-2011
Code:
while IFS="" read r; do printf "dummy\t%s\n" "$r";  done < xxx.txt > zzz.txt &
wait $!
while IFS="" read r; do printf "%s\tFY11\n" "$r"; done < zzz.txt > yyy.txt

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

How do I add extra ZFS swap in Solaris 11.3?

Hello, I have given 3 x 1 TB LUNs to add more swap space in a Solaris 11.3 OS -bash-4.4# swap -l swapfile dev swaplo blocks free /dev/zvol/dsk/rpool/swap 303,1 16 8388592 8388592 -bash-4.4# swap -s total: 84780376k bytes... (5 Replies)
Discussion started by: feroccimx
5 Replies

2. Shell Programming and Scripting

Need to Insert three extra columns in csv file

Hello Experts, I got a requirement i have a input file which am getting from different source,Now i want to add extra 3 columns to this file like BASE,ACTUAL and DATE. Input File Looks like QUAL CHGE TYP LAW COM1 COM2 A 1 X SED HO ASE B 3 Z CDE SE ... (5 Replies)
Discussion started by: ahmed.vaghar
5 Replies

3. Shell Programming and Scripting

Request: How to Parse dynamic SQL query to pad extra columns to match the fixed number of columns

Hello All, I have a requirement in which i will be given a sql query as input in a file with dynamic number of columns. For example some times i will get 5 columns, some times 8 columns etc up to 20 columns. So my requirement is to generate a output query which will have 20 columns all the... (7 Replies)
Discussion started by: vikas_trl
7 Replies

4. Shell Programming and Scripting

Randomly inserting extra columns into csv file

Hi Tech Guru, I have a test file as below , which needs some more fields to be populated randomly : dks3243;12;20130823;1420;25m;0;syt dks3243;rocy;10 dks3243;kiop;18 sde21p4;77;20151210;8479;7py;9;vfr sde21p4;temp;67 sfq6i01;12;20120123;3412;4rd;7;jui sfq6i01;uymk;90 sfq6i01;kiop;51 ... (8 Replies)
Discussion started by: Lokesha
8 Replies

5. UNIX for Dummies Questions & Answers

To Add extra commas to a CSV file.

Hi All, I got this requirement to process a complex CSV file. Eg File. Line 1: Name:,XYz Line 2: Age:,15 Line 3: Grade:,7 Line 4: Line 5: English, Maths, Science,Spanish Line 6:10,11,13,14 As you can see the maximum column is 4 . The file i need to make is Line 1: Name:,XYz,,... (12 Replies)
Discussion started by: chillblue
12 Replies

6. Shell Programming and Scripting

Remove extra characters and sum the columns

I have data extracted like this: A=%123% B=%456% C=%789% A=%111% B=%222% C=%333% A=%777% B=%888% C=%999% Can someone please help me with a script to remove all the % signs and get the totals for A, B and C. So output will be: A=1368 B=666 C=2664 Thank you! (2 Replies)
Discussion started by: tatchel
2 Replies

7. Shell Programming and Scripting

Single command for add 2 columns and remove 2 columns in unix/performance tuning

Hi all, I have created a script which adding two columns and removing two columns for all files. Filename: Cust_information_1200_201010.txt Source Data: "1","Cust information","123","106001","street","1-203 high street" "1","Cust information","124","105001","street","1-203 high street" ... (0 Replies)
Discussion started by: onesuri
0 Replies

8. Shell Programming and Scripting

how to flip values of two columns and add an extra column

Hi guys, Couldn't find the solution of this problem. Please Help! I have a file- Input_File TC200232 92 30 TC215306 2 74 TC210135 42 14 I want an output file in which if column2>column3, the values are swapped and an additional column with value Rev_Com is... (4 Replies)
Discussion started by: smriti_shridhar
4 Replies

9. Linux

How to add and extra hour to the start time

Hi Actually what am trying to ask is , i have an shell script ,now i want to run this shell script for one hour continuously and after one hour it has to stop automatically. can any one suggest me how to automate the shell script ? we tried wth the getting the start time and add ing an hour... (8 Replies)
Discussion started by: lalitka
8 Replies

10. Shell Programming and Scripting

manipulating csv to add extra row

hi how do i manipulate .csv file to add an extra row after each row using shell script? I need a blank line added for each 1000 records in my file? I will then need to copy and paste some data in the blank row created. thanks 4 ur support neil (3 Replies)
Discussion started by: neil546
3 Replies
Login or Register to Ask a Question