Sponsored Content
Full Discussion: Extract Columns from file
Top Forums Shell Programming and Scripting Extract Columns from file Post 302343293 by vfrg on Wednesday 12th of August 2009 05:52:28 AM
Old 08-12-2009
Extract Columns from file

Hi All,

Could you please help me with following:

I have to parse a .csv file.

For example: If the csv file contains 3 columns, then i have to print the column names. The field separator is (comma).

example.csv (contains 2 lines as follows)
This is,a test file, for validation purpose
This is,"""a test"", file","for validation "" pupose"""

I need the output like this:

1st line:
Input string: This is,a test file, for validation purpose
1st field:This is
2nd field:a test file
3rd field:for validation purpose

2nd line:
Input string: This is,"""a test"", file","for validation "" pupose"""
Actually from excel file, the data looks like this
(This is "a test", file for validation " pupose")
1st field:This is
2nd field:"a test", file
3rd field:for validation " pupose"

Thanks in advance for any tips.

Thanks,
Venkat
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Extract text in 2 columns of output file.

Hello!! I have the text file with following format... --SubTotal-----------------------------------0--161---------------44---13739369-67--- --SubTotal-----------------------------------0--147---------------0----49643---1----... (2 Replies)
Discussion started by: Danish Shakil
2 Replies

2. Shell Programming and Scripting

how to extract columns from a text file

Hi, In ksh, I have a file with similar rows as follows: Department = 1234 G/L Asset Acct No = 12.0000. 2/29/2008 Department = 1234 G/L Asset Acct No = 13.0000. 3/29/2008. I want to create a new text file that contains only the numbers and date: 1234 12.0000. 2/29/2008 1234 13.0000. ... (16 Replies)
Discussion started by: ihot
16 Replies

3. Shell Programming and Scripting

Help, need to extract columns from file

I have huge fixed width, text file in unix box and I need to extract columns found between the width 105 and 200 and output it to a new file. Can anyone tell me how to extract it? Thanks for your help. (1 Reply)
Discussion started by: kiran2k
1 Replies

4. Shell Programming and Scripting

extract columns from 2 different files and create new file

Hi All, I have 2 issues while working with file. 1. I have 2 delimited(~) files. I want to extract column numbner 3 from file1 and column number 8 from file2 and paste it into file3. I have tried using cut, but not able to get answer. 2. i have 2 filxed-width file. I wanted to do same... (1 Reply)
Discussion started by: Amit.Sagpariya
1 Replies

5. Shell Programming and Scripting

fileutility to extract columns from source file

Hi experts,Please help me for the below requirement.i have a source file.(lets say contains 50 columns). I am extarcting five columns from the source file by using pattern file.for exampleinput file:--------a,b,c,d,"a,g","v b",s,koutputfile=======a,"a,g","v b",s,kThanks in advancesubhendu (1 Reply)
Discussion started by: subhendu81
1 Replies

6. Shell Programming and Scripting

extract columns from file and send mail

Hi I have a file of the form name1,lastname1,email1@gmail.com,9.08243E+12,team1,role1,username1,password1 name2,lastname2,email2@gmail.com,9.08243E+11,team2,role2,username2,password2 I need to extract the email (column 3) and send a mail to each person, with their details ( specifically... (3 Replies)
Discussion started by: pkabali
3 Replies

7. Shell Programming and Scripting

Command to extract all columns except the last few from a txt file

hello, i have publicly available txt file with little less than 300000 rows. i want to extract from column 1 to column 218 and save it in another text file. i use the cut command but the file is saved with multiple rows from the source file onto a single row in the destination. basically it is... (6 Replies)
Discussion started by: madrazzii
6 Replies

8. UNIX for Dummies Questions & Answers

Extract spread columns from large file

Dear all, I want to extract around 300 columns from a very large file with almost 2million columns. There are no headers, but I can find out which column numbers I want. I know I can extract with the function 'cut -f2' for example just the second column but how do I do this for such a large... (1 Reply)
Discussion started by: fndijk
1 Replies

9. Shell Programming and Scripting

Extract columns into seperate file

I have a comma delimited file as per the one below and I am currently extracting the values in 2 columns (COL1 & COL6) to produce a smaller trimmed down version of the file which only contains the columns we need; COL1,COL2,COL3,COL4,COL5,COL6,COL7,COL8,COL9... (1 Reply)
Discussion started by: Ads89
1 Replies

10. Shell Programming and Scripting

Match Columns in one file and extract columns from another file

Kindly help merging information from two files with the following data structure. I want to match for the CHR-SNP in Foo and get the columns that match from CHROM-rsID Fields 1 & 2 of foo may have duplicates, however, a joint key of Fields $1$2$3$4 is unique. Also would be helpful to clean up... (4 Replies)
Discussion started by: genehunter
4 Replies
Tspi_TPM_CertifySelfTest(3)			     TCG Software Stack Developer's Reference			       Tspi_TPM_CertifySelfTest(3)

NAME
Tspi_TPM_CertifySelfTest- have the TPM sign its self test data SYNOPSIS
#include <tss/platform.h> #include <tss/tcpa_defines.h> #include <tss/tcpa_typedef.h> #include <tss/tcpa_struct.h> #include <tss/tss_typedef.h> #include <tss/tss_structs.h> #include <tss/tspi.h> TSS_RESULT Tspi_TPM_CertifySelfTest(TSS_HTPM hTPM, TSS_HKEY hKey, TSS_VALIDATION* pValidationData ); DESCRIPTION
Tspi_TPM_CertifySelfTest performs a self-test of each internal TPM function and returns an authenticated value (signature) if the test has passed. PARAMETERS
hTPM Handle of the TPM object hKey Handle of the signature key object pValidationData Validation data structure. [IN] Provide externalData information required to compute the signature. [OUT] On successful completion of the ocmmand, the structure provides a buffer containing the validation data and a buffer containing the data the validation data was computed from. RETURN CODES
Tspi_TPM_CertifySelfTest returns TSS_SUCCESS on success, otherwise one of the following values are returned: TSS_E_INVALID_HANDLE hTPM is not a valid handle to a TPM object. TSS_E_INTERNAL_ERROR An error occurred internal to the TSS. CONFORMING TO
Tspi_TPM_CertifySelfTest conforms to the Trusted Computing Group Software Specification version 1.1 Golden SEE ALSO
Tspi_TPM_SelfTestFull(3). TSS 1.1 2004-05-26 Tspi_TPM_CertifySelfTest(3)
All times are GMT -4. The time now is 09:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy