Sponsored Content
Top Forums Shell Programming and Scripting help in fetching a field from a file Post 302690459 by rkrish on Thursday 23rd of August 2012 05:01:35 AM
Old 08-23-2012
Question help in fetching a field from a file

I have an input file with contents like :
Code:
'1LTYSJSD2KQ8KLE' -audit_grp_id , internal error qty < recycle qty requested, skipping record
'1LTYSJSD2KQ8KLE' -audit_group_id, 0 records has been written, 1 was skipped
'1LTZLJRDFBEWJX9' -audit_grp_id , internal error qty < recycle qty requested, skipping record
'1LTZLJRDFBEWJX9' -audit_group_id, 0 records has been written, 1 was skipped
'1LTZLJRDGRA0TDT' -audit_grp_id , internal error qty < recycle qty requested, skipping record
'1LTZLJRDGRA0TDT' -audit_group_id, 0 records has been written, 1 was skipped
'1LTZLJRDK68THLM' -audit_grp_id , internal error qty < recycle qty requested, skipping record
'1LTZLJRDK68THLM' -audit_group_id, 0 records has been written, 1 was skipped
'1LV0FJRDG8A4VEE' -audit_grp_id , internal error qty < recycle qty requested, skipping record
'1LV0FJRDG8A4VEE' -audit_group_id, 0 records has been written, 1 was skipped


can any one help me in finding a way to fetch the frst word from each line..like '1LTZLJRDK68THLM','1LTZLJRDGRA0TDT' ?
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Fetching file from windows server

hi i am having 2 servers.... one having windows & the other one is having Solaris on it. Now i need to fetch files from windows server and copy them on to solaris server. the problem is that a new folder is created after every one hour in the window server and i have to fetch 2 files from this... (5 Replies)
Discussion started by: rochitsharma
5 Replies

2. UNIX Desktop Questions & Answers

Fetching unique values from file

After giving grep -A4 "feature 1," <file name> I have extracted the following text feature 1, subfeat 2, type 1, subtype 5, dump '30352f30312f323030392031313a33303a3337'H -- "05/01/2009 11:30:37" -- -- ... (1 Reply)
Discussion started by: shivi707
1 Replies

3. Shell Programming and Scripting

Fetching data from .csv file

Hi Experts, I have created a table with columns as empname,empid,phone,shiftname. Now I am having a .csv file format which contains the shift datas of the employees. I have to fetch this file and compare with the table I created to send an alert to the specified user. (2 Replies)
Discussion started by: micky3112
2 Replies

4. UNIX for Advanced & Expert Users

Fetching file name from directory

Hi Friends, I have to write a script to find the file name in the directory. file name in the directory is like sourcefile_abc_001.txt sourcefile_abc_002.txt sourcefile_abc_003.txt. valuename in the file i.e. between '_' and .txt i.e. 001 or 002 or 003 will be in another file and I... (1 Reply)
Discussion started by: manish8484
1 Replies

5. UNIX for Dummies Questions & Answers

Need help in not fetching a file while file writing operation is not completed

Hi All, We have a Unix program in oracle when we run the program this connects to specified ftp and will get the file into local server. We are facing a problem like when file writing operations is not completed, this program is getting the incomplete file. Could anyone please help me... (2 Replies)
Discussion started by: world.apps
2 Replies

6. Shell Programming and Scripting

Fetching from file and printing

Hi, i am using below command in shell scripting and getting the output. echo "dis qc(*) CLUSTER($clus) clusqmgr"|runmqsc -e XX.QM.CNEDCT1|egrep 'QUEUE|CLUSQMGR'|sed '$!N;s/\n/,/'|grep -v XX.QM.CNEDCT1here i think i need to put the output in a file and fetch for every CLUSQMGR. Output coming... (0 Replies)
Discussion started by: darling
0 Replies

7. Shell Programming and Scripting

File fetching from mysql database

I have a configuration file namely: abcd, that will be use for some service (like gammu) Inside that configuration file: number1 = 66673527 number1 = 8373272 How can I make the file to search the number1 and number2 from a mysql database? Any help will be very appreciated. Thanks (1 Reply)
Discussion started by: jazzyzha
1 Replies

8. Shell Programming and Scripting

Fetching variable from config file

I am using . .profile in my script below I want to fech it it from my configuration file .id_pass_file.txt(it has all user_name and passwords) how can i do this PROFILE_PATH=. .profile AND IN MY SCRIPT $PROFILE_PATH IS THIS CORRECT #!/bin/sh ORACLE_HOME=/var/opt/oracle/product/10g;... (8 Replies)
Discussion started by: rafa_fed2
8 Replies

9. Shell Programming and Scripting

Fetching columns from .csv file except last column

Hi, i have below list of files so i just want the name of the files in one parameter and not the timestamp. i want only GIDW_Dy_Tm_Seg_Sls_legacy_PL_0_0_ in variable of all files. GIDW_Dy_Tm_Seg_Sls_legacy_PL_0_0_20131001101800.csv GIDW_Dly_Sls_legacy_RO_0_0_20131001172001.csv ... (9 Replies)
Discussion started by: renuk
9 Replies

10. Shell Programming and Scripting

Fetching data from file

Hi All, I'm facing issue while using script. Chk_Etl_Status=`cat /dstage/questnet/qnetdv/input/Etl_Status.dat|cut -d"," -f1` echo Chk_Etl_Status=$Chk_Etl_Status above result is giving me sometime value as 1 and sometime error message as Chk_Etl_Status= dsjoblaunch.sh: test: Specify a... (5 Replies)
Discussion started by: Amit786
5 Replies
PX_GET_RECORD2(3)					     Library Functions Manual						 PX_GET_RECORD2(3)

NAME
PX_get_record2 -- Returns record in Paradox file SYNOPSIS
#include <paradox.h> int PX_get_record2(pxdoc_t *pxdoc, int recno, char *data, int *deleted, pxdatablockinfo_t *pxdbinfo) DESCRIPTION
This function is similar to PX_get_record(3) but takes two extra parameters. If *deleted is set to 1 the function will consider any record in the database, even those which are deleted. If *pxdbinfo is not NULL, the function will return some information about the data block where the record has been read from. You will have to allocate memory for pxdbinfo before calling PX_get_record2. On return *deleted will be set to 1 if the requested record is deleted or 0 if it is not deleted. The struct pxdatablockinfo_t has the fol- lowing fields: blockpos (long) File positon where the block starts. The first six bytes of the block contain the header, followed by the record data. recordpos (long) File position where the requested record starts. size (int) Size of the data block without the six bytes for the header. recno (int) Record number within the data block. The first record in the block has number 0. numrecords (int) The number of records in this block. number (int) The number of the data block. This function may return records with invalid data, because records are not explizitly marked as deleted, but rather the size of a valid data block is modified. A data block is a fixed size area in the file which holds a certain number of records. If for some reason a data block has newer been completely filled with records, the algorithmn anticipates deleted records in this data block, which are not there. This often happens with the last data block in a file, which is likely to not being fully filled with records. If you accessing several records, do it in ascending order, because this is the most efficient way. Note: This function is deprecated. Use PX_retrieve_record(3) instead RETURN VALUE
Returns 0 on success and -1 on failure. SEE ALSO
PX_get_field(3), PX_get_record(3) AUTHOR
This manual page was written by Uwe Steinmann uwe@steinmann.cx. PX_GET_RECORD2(3)
All times are GMT -4. The time now is 08:47 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy