Sponsored Content
Top Forums Shell Programming and Scripting How to split the comma separated file? Post 302769175 by gary_w on Monday 11th of February 2013 11:33:18 AM
Old 02-11-2013
Code:
#!/bin/ksh

while IFS=',' read part1 part2; do
  printf "%s,%s %s\n" $part1 $part2 $part1
  printf "%s,%s %s\n" $part1 $part2 $part2
done < filename

exit 0

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Remove whitespaces between comma separated fields from file

Hello all, I am a unix dummy. I am trying to remove spaces between fields. I have the file in the following format 12332432, 2345 , asdfsdf ,100216 , 9999999 12332431, 2341 , asdfsd2 ,100213 , 9999999 &... (2 Replies)
Discussion started by: nitinbjoshi
2 Replies

2. Shell Programming and Scripting

Converting comma separated to pipe delimited file

Hi, I came across a very good script to convert a comma seperated to pipe delimited file in this forum. the script serves most of the requirement but looks like it does not handle embedded double quotes and commas i.e if the input is like 1234, "value","first,second", "LDC5"monitor",... (15 Replies)
Discussion started by: anijan
15 Replies

3. Shell Programming and Scripting

How to format file into comma separated field

Guys, Need you help, i have a a file content that look like this. Nokia 3330 <spaces><spaces><more spaces>+76451883874 Nokia 3610 +87467361615 so on and so forth, - there are so many spaces in between. - e.g.... (5 Replies)
Discussion started by: shtobias
5 Replies

4. Shell Programming and Scripting

parsing comma separated file

Hi, I have a file with th elist of patches separated by comma, like below: patch1, patch 2, patch 3................ t\The number of patches is not known as it changes every time. I need assistance in writing a routine such as it will take patch1 as first variable and performs the... (4 Replies)
Discussion started by: avikaljain
4 Replies

5. Shell Programming and Scripting

Inserting string in between field in comma separated file

Hello Mates, I have one txt file having commo seperated values. I have to insert string "FALSE" in 2nd field from the end. E.G SE18 6RN,,,,5439070,1786840,,1000002148671600,123434 Out put should be: SE18 6RN,,,,5439070,1786840,FALSE,1000002148671600,123434 Can some one help me to... (8 Replies)
Discussion started by: krsnadasa
8 Replies

6. Shell Programming and Scripting

Comma separated file

Hi all, I have the following files types: FileA: 100, 23, 33, FileB: 22, 45, 78, and i want to make File C: 100,22 23,45 33,78 any nice suggestions for making it easy. (3 Replies)
Discussion started by: hen1610
3 Replies

7. Shell Programming and Scripting

Need Help - comma inside double quote in comma separated csv,

Hello there, I have a comma separated csv , and all the text field is wrapped by double quote. Issue is some text field contain comma as well inside double quote. so it is difficult to process. Input in the csv file is , 1,234,"abc,12,gh","GH234TY",34 I need output like below,... (8 Replies)
Discussion started by: Uttam Maji
8 Replies

8. UNIX for Dummies Questions & Answers

[solved] Comma separated values to space separated

Hi, I have a large number of files which are written as csv (comma-separated values). Does anyone know of simple sed/awk command do achieve this? Thanks! ---------- Post updated at 10:59 AM ---------- Previous update was at 10:54 AM ---------- Guess I asked this too soon. Found the... (0 Replies)
Discussion started by: lost.identity
0 Replies

9. Shell Programming and Scripting

Convert comma separated file to fix length

Hi, I am converting a comma separated file to fixed field lenght and I am using that: COLUMNS="25 24 67 26 39 63 20 34 35 14 397" ( cat $indir/input_file.dat | \ $AWK -v columns="$COLUMNS" ' BEGIN { FS=","; OFS=""; split(columns, arr, " "); } { for(i=1; i<=NF;... (5 Replies)
Discussion started by: apenkov
5 Replies

10. Shell Programming and Scripting

awk to parse comma separated field and removing comma in between number and double quotes

Hi Experts, Please support I have below data in file in comma seperated, but 4th column is containing comma in between numbers, bcz of which when i tried to parse the file the column 6th value(5049641141) is being removed from the file and value(222.82) in column 5 becoming value of column6. ... (3 Replies)
Discussion started by: as7951
3 Replies
dtfilsys(file formats)													    dtfilsys(file formats)

NAME
dtfilsys -- CDE file system; directory tree structure DESCRIPTION
The CDE file system is divided into three parts: the root system, /usr/dt, the configuration directory, /etc/dt, and the temporary direc- tory, /var/dt. The root system, /usr/dt, is a read-only directory. It contains all the files that comprise the CDE. The configuration directory, /etc/dt, is the directory CDE applications will search to locate configuration files that have been modified by the system administrator. Default versions of these configuration files are typically located in /usr/dt. The temporary directory, /var/dt, contains temporary information or information that varies in size and existence. Below is a diagram of the directory tree structure for CDE. /etc/dt/appconfig/appmanager/<Lang> /help/<Lang> /icons/<Lang> /types/<Lang> /backdrops/<Lang> /config /palettes/<Lang> /usr/dt/app-defaults/<Lang> /appconfig/appmanager/<Lang> /help/<Lang> /icons/<Lang> /types/<Lang> /bin /config /lib /share/backdrops/<Lang> /include /examples /man /palettes/<Lang> /var/dt/appconfig/appmanager $HOME/.dt/appmanager /help /icons /palettes /sessions /types The following guidelines apply to the contents of these directories: /usr/dt This directory is for use by the CDE system. Applications should never create files in this directory although they may read and execute them. /usr/dt/app-defaults/<Lang> This directory contains the localized versions of the app-defaults files for the CDE clients. /usr/dt/appconfig/appmanager/<Lang> This directory contains the localized versions of the actions files used by the Application Manager. /usr/dt/appconfig/help/<Lang> This directory contains the localized versions of the CDE help volumes and help files. /usr/dt/appconfig/icons/<Lang> This directory contains the localized versions of the icons used by the CDE clients. /usr/dt/appconfig/types/<Lang> This directory contains the localized versions of the actions and data types used by the CDE clients. /usr/dt/bin This directory contains the CDE clients. /usr/dt/config This directory contains default configuration files. /usr/dt/lib This directory contains the shared libraries used by the CDE clients. /usr/dt/share This directory contains CDE elements, typically ASCII files, that are independent of the architecture. /usr/dt/share/backdrops/<Lang> This directory contains the localized versions of the backdrops used by the window manager workspaces and by the Style Manager. /usr/dt/share/examples This directory contains examples of CDE functionality. /usr/dt/share/include This directory is part of the developmewnt environment and includes header files associated with CDE. /usr/dt/share/man This directory contains the man pages for the CDE clients. /usr/dt/share/palettes/<Lang> This directory contains the localized versions of the palettes used by the Style Manager to determine the color scheme. /etc/dt This directory is specified as the CDE configuration directory. /etc/dt/appconfig This directory is used to hold system-administrator defined configuration files /etc/dt/appconfig/appmanager/<Lang> This directory is used to hold system-administrator defined configuration files for the Application Manager. /etc/dt/appconfig/help/<Lang> This directory is used to hold system-administrator defined configuration files for the Help system. /etc/dt/appconfig/icons/<Lang> This directory is used to hold system-administrator defined configuration files for icons. /etc/dt/appconfig/types/<Lang> This directory is used to hold system-administrator defined configuration files for the action and filetype database. /etc/dt/backdrops/<Lang> This directory contains backdrops provided by the system administrator. /etc/dt/config This directory is to contain modified versions of the CDE configuration files (installed in /usr/dt/config). /etc/dt/palettes/<Lang> This directory contains palettes provided by the system administrator. /var/dt This directory is used by CDE for some log files, temporary files, and files that vary in size. /var/dt/appconfig/appmanager This directory is created at login and is used by the Application Manager. $HOME/.dt This directory contains information specific to the user. $HOME/.dt/appmanager This directory is used to hold user-defined configuration files for the Application Manager. $HOME/.dt/backdrops This directory is used to hold user-customized backdrops for the Style Manager. $HOME/.dt/help This directory is used to hold user-defined configuration files for the Help system. $HOME/.dt/icons This directory is used to hold user-defined configuration files for icons. $HOME/.dt/palettes This directory is used to hold user-customized palettes for the Style Manager. $HOME/.dt/sessions This directory is used to store session information between CDE sessions. $HOME/.dt/tmp This directory is used to hold temporary information. $HOME/.dt/types This directory is used to hold user-defined configuration files for the action and filetypes database. The Minimum Runtime Environment The minimum environment required for a system to support CDE consists of the following files and directories: /usr/dt/app-defaults/C/ tpad Dtksh Dtterm /usr/dt/appconfig/tttypes/ types.xdr /usr/dt/bin/ dsdm dtaction dtappgather dtappintegrate dtexec dtksh dtpad dtspcd dtterm suid_exec rpc.ttdbserver tt_type_comp ttsession SEE ALSO
dtenvvar(5) dtfilsys(file formats)
All times are GMT -4. The time now is 05:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy