Sponsored Content
Full Discussion: Rearange fields within a csv
Top Forums Shell Programming and Scripting Rearange fields within a csv Post 302482329 by drbiloukos on Tuesday 21st of December 2010 08:49:01 AM
Old 12-21-2010
Sample from my cron:

Code:
00 05  *  *  * (. ~/.profile ; timex /Data/bin/load_data.sh /Data/bin/load.cfg ) >> /Data/logs/load_data.log 2>&1
00 07 *  *  * (. ~/.profile ; timex /Data/bin/process -1 0 )   >> /Data/logs/processs.log 2>&1
#30 15,00 *  *  3,6     (. ~/.profile ; timex /Data/bin/analyze ) >> /Data/logs/analyze.log 2>&1

As you can see some script use cfg files and some use parameters.
I need to have ;; if no parameter is specified so it will load in the right column
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to work with fields of a csv file?

I need to insert data into a perticular field of a csv file, lets say second field. Can any one help me to do this? I found that we can do it with sed. can any one guide me to accomplish this? thanks in advance. (12 Replies)
Discussion started by: praveen_b744
12 Replies

2. UNIX for Dummies Questions & Answers

Fields in csv files using sed

Hi, I am working right now with a csv file and I want to insert an excel formula say to the 6th column. sample csv file: 1234,lag,0,77,544,,7 1234,lag,222,0,7,,7 at first i used a simple command: sed 's/^\(.\{17\}\)/\1word/' file.csv but the result is this: ... (2 Replies)
Discussion started by: paoie
2 Replies

3. Shell Programming and Scripting

awk - rearange data

Dear All, once again I am encountering a problem with awk. The file looks like this: BroadLeaves 43.6 clc2006 37.6 Conifers 8.3 edge100 5.1 dem30sec 3.9 aspect 1.5 slope 0 dem30sec 58.3 Conifers 28.5 clc2006 7.3 edge100 3 slope 2.4 BroadLeaves 0.4 aspect 0.1 .... ... .. My... (9 Replies)
Discussion started by: creamcheese
9 Replies

4. Shell Programming and Scripting

How to (n)awk lines of CSV with certain number of fields?

I have a CSV file with a variable number of fields per record. How do I print lines of a certain number of fields only? Several permutations of the following (including the use of escape characters) have failed to retrieve the line I'm after (1,2,3,4)... $ cat myfile 1,2,3,4 1,2,3 $ # Print... (1 Reply)
Discussion started by: cs03dmj
1 Replies

5. Shell Programming and Scripting

pulling different fields from a csv file

Hi, I have a requirment where I need to pull different columns from a .csv file. Here is the sample of the csv file. account,item,flag1,flag2,flag3,flag4,flag5,......feed,tran I will be have a config.txt file which will have the following information. item,flag5,flag10,feed,tran... (2 Replies)
Discussion started by: akdevula
2 Replies

6. Shell Programming and Scripting

compare 2 CSV fields from same diff output

Attached is a file called diff.txt It is the output from this command: diff -y --suppress-common-lines --width=5000 1.txt 2.txt > diff.txt I have also attached 1.txt and 2.txt for your convenience. Both 1.txt and 2.txt contain one very long CSV string. File 1.txt is a CSV dump of... (0 Replies)
Discussion started by: gvolpini
0 Replies

7. Shell Programming and Scripting

Inserting new fields to a csv file

hi I have a csv file with few rows > cat job_stat 1,jobname1,somthing,somthing 2,jobname2,somthing,somthing 3,jobname3,somthing,somthing 4,jobname4,somthing,somthing I want to add few columns after the 2nd column and then append rest of the columns after the 3rd newly added... (3 Replies)
Discussion started by: midhun19
3 Replies

8. Shell Programming and Scripting

Merging fields in CSV

Hi experts, I have a csv file which has one field (ID) repeated multiple times with corresponding other field values. I need to convert this file in a format where for a ID all other values has to be present in single field. For Eg : Here in below file ID 1 is repeated 3 times with different... (7 Replies)
Discussion started by: bharathbangalor
7 Replies

9. Emergency UNIX and Linux Support

How to convert the following characters in some fields in a csv file?

I have a csv file which is produced out of a SED command sed 's/|/","/g; s/^/"/; s/$/"/' A4.txt > A5.csv and I need either an addition to the SED command or a separate command to convert the following characters which occur within the fields in multiple lines 1) "=" to =" and 2)""~ to " (4 Replies)
Discussion started by: etldev
4 Replies

10. UNIX for Beginners Questions & Answers

How to extract fields from a CSV i.e comma separated where some of the fields having comma as value?

can anyone help me!!!! How to I parse the CSV file file name : abc.csv (csv file) The above file containing data like abv,sfs,,hju,',',jkk wff,fst,,rgr,',',rgr ere,edf,erg,',',rgr,rgr I have a requirement like i have to extract different field and assign them into different... (4 Replies)
Discussion started by: J.Jena
4 Replies
Data::Serializer::Convert::Bencode(3pm) 		User Contributed Perl Documentation		   Data::Serializer::Convert::Bencode(3pm)

NAME
Data::Serializer::Convert::Bencode - Creates bridge between Data::Serializer and Convert::Bencode SYNOPSIS
use Data::Serializer::Convert::Bencode; DESCRIPTION
Module is used internally to Data::Serializer serialize - Wrapper to normalize serializer method name deserialize - Wrapper to normalize deserializer method name AUTHOR
Neil Neely <neil@neely.cx>. http://neil-neely.blogspot.com/ BUGS
Please report all bugs here: http://rt.cpan.org/Public/Dist/Display.html?Name=Data-Serializer COPYRIGHT AND LICENSE
Copyright (c) 2011 Neil Neely. All rights reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.2 or, at your option, any later version of Perl 5 you may have available. SEE ALSO
perl(1), Data::Serializer(3), Convert::Bencode(3). perl v5.12.4 2011-08-16 Data::Serializer::Convert::Bencode(3pm)
All times are GMT -4. The time now is 07:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy