Sponsored Content
Top Forums Shell Programming and Scripting Shell script for .Txt to .csv conversion with data processing Post 302930437 by RudiC on Sunday 4th of January 2015 05:08:14 AM
Old 01-04-2015
Having read and appreciating the comments, and being as overwhelmed as the others by the data files, and having removed the <CR> line terminators from the DOS/windows files, I'd like to propose for discussion (hoping to have guessed the requirements correctly)
Code:
awk     'FNR==NR        {T[$1]=$2; next}
         FNR==1         {$0=toupper($0) 
                         for (n=1; n<=100; n++) if ($n in T) C[$n]=n
                         getline
                         next   
                        }
                        {for (n in T) if (C[n]) print FNR, n, T[n], $4, $(C[n])
                        }
        ' OFS="," /tmp/paramaters.txt /tmp/CNAI_DUMP_RAW1.txt

This is working on a subset of the data; applying it to the entire data set as well as redirecting it to the desired output file is left to the reader.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script to format a .CSV data

Hi There I needed to write a Unix shell script which will pick up the data from a .CSV file and reformat it as per the requirement and write it to another .CSV file. Currently I am in the proess of Data Import to "Remedy System" (A one kind of incident mangement Application) and this... (8 Replies)
Discussion started by: Uday1982
8 Replies

2. Shell Programming and Scripting

shell script to insert data from gps.txt to mysql database

Hi, I have gps receiver, by using gpsd data i can read gps log data to my database(my sql). Steps: 1. telenet localhost 2947 > gps.txt (press enter) 2. r (press enter) //then i will get the data like below in gps.txt file Trying 127.0.0.1... Connected to localhost.... (1 Reply)
Discussion started by: gudivada213
1 Replies

3. UNIX for Advanced & Expert Users

shell script to format .CSV data

Hi all, I have written a shell script to search a specified directory (e.g. /home/user) for a list of specific words (shown as ${TMPDIR}/wordlist below). The script works well enough, but I was wondering if there was a way to display the line number that the word is found on? Thanks! cat... (1 Reply)
Discussion started by: tmcmurtr
1 Replies

4. Shell Programming and Scripting

Shell script for CSV conversion

thanks for allowing me join your forum i have an output of linux command "who" which provides following details..... CURRENT USER/ACCT INFO 17:31:36 up 4:49, 4 users, load average: 0.03, 0.04, 0.00 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT root :0 - 12:59 ?xdm? 4:54 0.02s /bin/sh /usr/bi... (1 Reply)
Discussion started by: ayyappancheta
1 Replies

5. Shell Programming and Scripting

Conversion of below Tabs Tex file into CSV format file : shell script needed

Request if some one could provide me shell script that converts the below "input file" to "CSV format file" given Name Domain Contact Phone Email Location ----------------------- ------------------------------------------------ ------- ----- ---------------------------------... (7 Replies)
Discussion started by: sreenath1037
7 Replies

6. Shell Programming and Scripting

Conversion of xhtml data into csv format using dump utility

Hi Unix Gurus, I tried to convert the attached xhtml table content into csv file using unix shell script (lynx -dump filename) and got the below results: Title ID Owner Priority Estimate Project Change Date Changed By Complexity Create Date Created By Detail Estimate Total De tail... (6 Replies)
Discussion started by: bi.infa
6 Replies

7. Shell Programming and Scripting

Copy data to CSV file from txt output

Hi Everyone , Below is output from a TL1 , I want just the NE Name: and beside that the Temperature and the voltages in a csv file , Is this possible? > act-user:AB1S2a:ArshadFO:493::**********; AB1S2a 2016-02-07 10:13:24 M 493 COMPLD "ArshadFO:2016-02-07 10-04-55,0" ;... (11 Replies)
Discussion started by: adgjmpt
11 Replies

8. Shell Programming and Scripting

Help with Shell Scrip in Masking particular columns in .csv file or .txt file using shell script

Hello Unix Shell Script Experts, I have a script that would mask the columns in .csv file or .txt file. First the script will untar the .zip files from Archive folder and processes into work folder and finally pushes the masked .csv files into Feed folder. Two parameters are passed ... (5 Replies)
Discussion started by: Mahesh G
5 Replies

9. Shell Programming and Scripting

How to get the shell script to read the .txt file as an input/data?

i have written my shell script in notepad however i am struggling to pass the data file to be read to the script the data file is of .txt format. My target is to run the shell script from the terminal and pass 3 arguments e.g. polg@DESKTOP-BVPDC5C:~/CS1420/coursework$ bash valsplit.sh input.txt... (11 Replies)
Discussion started by: Gurdza32
11 Replies
dxmtools(1)						      General Commands Manual						       dxmtools(1)

NAME
dxmtools - DOS Tools Graphical User Interface for manipulating files on an MSDOS diskette SYNOPSIS
/usr/bin/X11/dxmtools OPTIONS
DESCRIPTION
The DOS Tools application, dxmtools, uses a graphical user interface to copy files to and from an MSDOS formatted diskette to manipulate files on that diskette, in the same manner as the mtools(1) commands, which are accessed from the command line interface. The DOS Tools application accepts the standard X11 resource options. For more information, see the X(1X) reference page Use the DOS Tools application to: Copy a diskette file to Tru64 UNIX Copy Tru64 UNIX files to the diskette Create a directory on the diskette Delete diskette files Format a diskette Change the diskette volume label Change the archive, read-only, hidden, and system attribute bits on a diskette file Display the contents of a diskette file Find a diskette file by its name, size, or attribute settings Rename a diskette file. MSDOS filenames are optionally composed of a drive letter followed by a colon, optional subdirectories, and a filename. Subdirectory names can use either the '/' or '' separator. The current working directory relative to the diskette is A:/. The regular expression pattern matching routines follow the UNIX-style rules. For example, an asterisk (*), in place of asterisks separated by a dot (.) that is *.*, matches all MSDOS files. The archive, hidden, read-only, and system attribute bits are ignored during pattern matching. The DOS Tools application requires a diskette properly installed on the system. The DOS Tools application addresses a device named /dev/disk/floppy; a symbolic link between the diskette device and /dev/disk/floppy is required. Online help is available for the dxmtools application. To get help, click on any Help button or use the Help pull-down menu. The DOS Tools application can be invoked from: The CDE Application Manager. Application Group: Desktop_Apps Desktop_Apps Subgroup: dxmtools EXAMPLES
Invoke the DOS Tools application from the command line. /usr/bin/X11/dxmtools Open the DOS Tools help volume from the command line without running the application. /usr/dt/bin/dthelpview -h /usr/dt/appconfig/help/C/dxmtools.sdl FILES
DOS Tools executable DOS Tools Help Volume Symbolic link for diskette drive. SEE ALSO
Commands: ln(1), mattrib(1), mcd(1), mcopy(1), mdel(1), mdir(1), mlabel(1), mmd(1), mrd(1), mread(1), mren(1), mtools(1), mtype(1), mwrite(1), X(1X) Diskette interface: fd(7) Utilities: MAKEDEV(8), mknod(8) dxmtools(1)
All times are GMT -4. The time now is 06:40 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy