Need help with extracting field


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Need help with extracting field
# 8  
Old 06-09-2010
Hi Gini,

I think I wasn't clear. I tried doing that but the problem that I'm still facing is that this solution produces output as follows:

name, description, status

Therefore it is not a problem for most rows but I still have about over 120 rows where the description is a long sentence with commas in between.

Hence when the output in spreadsheet is separated into columns using comma as the separator to direct them into columns, the descriptions with commas get separated as well.

Else this would be great if the descriptions do not contain commas in between. I'm thinking probably getting it sorted that was in the script itself would not cause this problem in the output.

---------- Post updated at 11:41 PM ---------- Previous update was at 11:33 PM ----------

problem solved. thanks everyone

---------- Post updated at 11:41 PM ---------- Previous update was at 11:41 PM ----------

problem solved. thanks everyone
# 9  
Old 06-09-2010
thts cool.....
would like to hear from u, whether you sticked to making changes at script level, or you tweaked around with excel ...?
# 10  
Old 06-09-2010
I guess a little changes in the code by replacing "," with some other special character and a bit of tweak in Excel as well is needed to get this done. Smilie
# 11  
Old 06-09-2010
yeap Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Display combination of 4 field uniqe record and along with concatenate 5th and 6th field.

Table ACN|NAME|CITY|CTY|NO1|NO2 115|AKKK|ASH|IND|10|15 115|AKKK|ASH|IND|20|20 115|AKKK|ASH|IND|30|35 115|AKKK|ASH|IND|30|35 112|ABC|FL|USA|15|15 112|ABC|FL|USA|25|20 112|ABC|FL|USA|25|45 i have written shell script using cut command and awk programming getting error correct it and add... (5 Replies)
Discussion started by: udhal
5 Replies

2. Linux

How do I format a Date field of a .CSV file with multiple commas in a string field?

I have a .CSV file (file.csv) whose data are all enclosed in double quotes. Sample format of the file is as below: column1,column2,column3,column4,column5,column6, column7, Column8, Column9, Column10 "12","B000QRIGJ4","4432","string with quotes, and with a comma, and colon: in... (3 Replies)
Discussion started by: dhruuv369
3 Replies

3. Shell Programming and Scripting

Extracting field values from .csv

How can I select the bold fields from the following? "CLLI","SWREL","RPTDATE","RPTIME","TZ","RPTTYPE","RPTPD","IVALDATE","IVALSTART","IVALEND","NUMENTIDS" "tklc9010801","EAGLE5 45.0.0-64.70.1","2013-08-07","02:01:50","MST ","COMPONENT MEASUREMENTS ON... (4 Replies)
Discussion started by: leghorn
4 Replies

4. Shell Programming and Scripting

awk - extracting a field

Hi all, I have automated a process of doing a sanity check for the DDL created by other DBA's. But i am stuck at a point. while reading a file in the awk, PI of the table is defined as )PRIMARY INDEX test_abc(ACCT_ID) PARTITION BY RANGE_N(AUTHZN_MTCH_IND BETWEEN DATE '2011-10-01' AND... (1 Reply)
Discussion started by: ysvsr1
1 Replies

5. Shell Programming and Scripting

Extracting duplicates from a desired field

Hello, I have a file of group names and GID's (/etc/group) and I want to find the duplicate group names and put them in a file. So there are 2 fields, i.e.: audit 10 avahi 70 avahi-autoipd 103 bellrpi 605 bin 1 bin 2 bord 512 busobj 161 bwadm 230 cali81 202 card 323 cardiff 901 cbm... (2 Replies)
Discussion started by: mgb
2 Replies

6. Shell Programming and Scripting

awk, comma as field separator and text inside double quotes as a field.

Hi, all I need to get fields in a line that are separated by commas, some of the fields are enclosed with double quotes, and they are supposed to be treated as a single field even if there are commas inside the quotes. sample input: for this line, 5 fields are supposed to be extracted, they... (8 Replies)
Discussion started by: kevintse
8 Replies

7. Shell Programming and Scripting

Extracting field from array

I have a problem with the following lines of code: SaveIFS=$IFS IFS="/" declare -a Array=($1)#take unix path, split by '/' website=${Array} #stores website name The confusing part is that it works on one machine, but not on the other. If the code is... (2 Replies)
Discussion started by: montana24
2 Replies

8. Shell Programming and Scripting

Extracting a field value from a line

Used TNSNAMES adapter to resolve the alias Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.12.11.255)(PORT = 1540)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = CSMFIRE03))) I would like to extract the CSMFIRE03. I have no clue which command to use. Could... (5 Replies)
Discussion started by: Naresh Akkal
5 Replies

9. Programming

Extracting Field values for XML file

i have an input file of XML type with data like <nx-charging:additional-parameter name="NX_INTERNATIONALIZED_CLID" value="919427960829"/><nx-charging:finalStatus>RESPONSE , Not/Applicable , OK</nx-charging:finalStatus></nx-charging:process> i want to extract data such that i get the output... (3 Replies)
Discussion started by: junaid.nehvi
3 Replies

10. Shell Programming and Scripting

extracting a field from directory path ??????

Hi I'll be getting a directory path as the input to the script. E.g. 1 abc/fsg/sdfhgsa/fasgfsd/adfghad/XXX/fhsad e.g. 2 sadfg/sadgjhgds/sd/dtuc/cghcx/dtyue/dfghsdd/XXX/qytq This input will be stored in a variable. My query is how to extract the field in a variable VAR which occurs... (15 Replies)
Discussion started by: skyineyes
15 Replies
Login or Register to Ask a Question