Sponsored Content
Top Forums Shell Programming and Scripting insert data into specific lines of a CSV Post 302448614 by tlarkin on Thursday 26th of August 2010 12:17:20 PM
Old 08-26-2010
Quote:
Originally Posted by Corona688
This is not a CSV file incidentally, CSV is "comma-seperated". But what are you trying to substitute, where? What should it look like in the end, based on what data?
sorry it is plain text....i just open it up in excel to modify it so I had the mindset it was a CSV file...

These are the data strings I need to insert

W8738625Z5V is the serial number

922-9592 would be the part number

USA075WB would be the tech ID of the person creating the order

Then the rest is just info about contacting us That stuff can just be mass copied and pasted. However, I would like to plug in some variables and strings to populate the serial numbers. I can run a report of serial numbers form our back end inventory management software, and I can just copy/paste or source them as plain text. It should look just like the above example. Then I upload that text file to the vendor's web based parts ordering system and it either parses the data and OK's it, or rejects it.

Last edited by tlarkin; 08-26-2010 at 01:26 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Insert lines at specific location in file

Hi There I have this file that I would like to add entries to, however, there is a "}" as the last line that I need to keep. Basically i would like to know how I can write a script that will add new lines at the second to last line position (ie always add new line above the close bracket) ... (17 Replies)
Discussion started by: hcclnoodles
17 Replies

2. Shell Programming and Scripting

Insert 2 lines in a file at a specific location

Hi, I need to insert two new lines in a file: The file: "..... ...... ULIMIT_MAX_FILES="ulimit -S -n `ulimit -H -n`" .... .... " I need to add the lines: LD_LIBRARY_PATH='$LD_LIBRARY_PATH:$APACHE_HOME/modules' DOWNLOADMODULE_CONF_PATHNAME='$APACHE_HOME/conf/DWLModule.cfg' right... (2 Replies)
Discussion started by: potro
2 Replies

3. Homework & Coursework Questions

Displaying specific lines from a CSV file

1. The problem statement, all variables and given/known data: Display from a csv file, birthdays that occur today. If there are no birthdays today, the next one in the year. 2. Relevant commands, code, scripts, algorithms: The csv file is ordered from older to younger (ie. the most recent... (8 Replies)
Discussion started by: Adzi
8 Replies

4. Shell Programming and Scripting

Can sed be used to insert data at specific column?

I'm trying to use sed to insert data at a specific column, let's say my data looks like this: 0553 1828 0552 1829 0550 1829 0549 1830 0548 1831 what I want is this: timein 0553 timeout 1828 timein 0552 timeout 1829 timein 0550 timeout 1829 timein 0549 timeout 1830 timein 0548... (5 Replies)
Discussion started by: mswartz
5 Replies

5. Shell Programming and Scripting

Extracting specific lines of data from a file and related lines of data based on a grep value range?

Hi, I have one file, say file 1, that has data like below where 19900107 is the date, 19900107 12 144 129 0.7380047 19900108 12 168 129 0.3149017 19900109 12 192 129 3.2766666E-02 ... (3 Replies)
Discussion started by: Wynner
3 Replies

6. Shell Programming and Scripting

CSV to SQL insert: Awk for strings with multiple lines in csv

Hi Fellows, I have been struggling to fix an issue in csv records to compose sql statements and have been really losing sleep over it. Here is the problem: I have csv files in the following pipe-delimited format: Column1|Column2|Column3|Column4|NEWLINE Address Type|some descriptive... (4 Replies)
Discussion started by: khayal
4 Replies

7. Shell Programming and Scripting

Insert text line to specific location CSV

In Perl. ***edited question below*** Hey all, I am teaching myself some simple CSV file manipulation and have become a little stuck. Say I have the following layout in the CSV file: age,name,locationIs it possible to INSERT data into the CSV into the correct age order. For example, if I had... (1 Reply)
Discussion started by: whyte_rhyno
1 Replies

8. Shell Programming and Scripting

Insert charactera in 1st position of specific lines using vi editor or sed command

Dear all, i am having text file like below surya rama ranga laxman rajesh reddy i want add string (OK) before a text from line 3 to 5 the result will be surya rama OK ranga OK laxman OK rajesh reddy (1 Reply)
Discussion started by: suryanarayana
1 Replies

9. Shell Programming and Scripting

Script to ingest a csv, validate data and insert into Oracle

Hi all i would appreciate your help... I am looking for a set of unix commands which i can use to 1) ingest a csv file with a known format 2) validate the filename 3) validate the data/datatypes 4) Insert into an oracle db Can you help get me started? yogz888 (1 Reply)
Discussion started by: yogz888
1 Replies

10. UNIX for Beginners Questions & Answers

Possible to insert a few lines of code into a file at a specific point?

Hi Folks - How would I go about inserting a chunk of lines (3) into a specific portion of a file? The background is I have a script (non shell) that it executed daily, however on Sundays, I uncomment a section of code so that piece can be run as well. So I was hoping to write a piece of... (9 Replies)
Discussion started by: SIMMS7400
9 Replies
bon_csv2html(1) 					      General Commands Manual						   bon_csv2html(1)

NAME
bon_csv2html program to convert CSV format Bonnie++ data to a HTML form using tables suitable for display on a web page. NB Lynx can't dis- play this properly, and due to the size it probably requires 1024x768 monitor to display properly. bon_csv2txt program to convert CSV format Bonnie++ data to plain-text format suitable for pasting into an email or reading on a Braille display. DESCRIPTION
They take CSV format (comma-delimited spreadsheet files AKA Comma Seperated Values in MS land) data on standard input and produce HTML or plain text on standard output respectively. FORMAT
This is a list of the fields used in the CSV files format version 2. Format version 1 was the type used in Bonnie++ < 1.90. Before each field I list the field number as well as the name given in the heading 0 format_version Version of the output format in use (1.96) 1 bonnie_version (1.96) 2 name Machine Name 3 concurrency The number of copies of each operation to be run at the same time 4 seed Random number seed 5 file_size Size in megs for the IO tests 6 chunk_size Size of chunks in bytes 7 putc,putc_cpu Results for writing a character at a time K/s,%CPU 9 put_block,put_block_cpu Results for writing a block at a time K/s,%CPU 11 rewrite,rewrite_cpu Results for reading and re-writing a block at a time K/s,%CPU 13 getc,getc_cpu Results for reading a character at a time K/s,%CPU 15 get_block,get_block_cpu Results for reading a block at a time K/s,%CPU 17 seeks,seeks_cpu Results for the seek test seeks/s,%CPU 19 num_files Number of files for file-creation tests (units of 1024 files) 20 max_size The maximum size of files for file-creation tests. Or the type of files for links. 21 min_size The minimum size of files for file-creation tests. 22 num_dirs The number of directories for creation of files in multiple directories. 23 file_chunk_size The size of blocks for writing multiple files. 24 seq_create,seq_create_cpu Rate of creating files sequentially files/s,%CPU 26 seq_stat,seq_stat_cpu Rate of reading/stating files sequentially files/s,%CPU 28 seq_del,seq_del_cpu Rate of deleting files sequentially files/s,%CPU 30 ran_create,ran_create_cpu Rate of creating files in random order files/s,%CPU 32 ran_stat,ran_stat_cpu Rate of deleting files in random order files/s,%CPU 34 ran_del,ran_del_cpu Rate of deleting files in random order files/s,%CPU 36 putc_latency,put_block_latency,rewrite_latency Latency (maximum amount of time for a single operation) for putc, put_block, and reqrite 39 getc_latency,get_block_latency,seeks_latency Latency for getc, get_block, and seeks 42 seq_create_latency,seq_stat_latency,seq_del_latency Latency for seq_create, seq_stat, and seq_del 45 ran_create_latency,ran_stat_latency,ran_del_latency Latency for ran_create, ran_stat, and ran_del A string that starts with '#' is a comment. AUTHOR
These programs were written by Russell Coker <russell@coker.com.au>. May be freely used and distributed without restriction. bon_csv2html(1)
All times are GMT -4. The time now is 01:22 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy