Sponsored Content
Top Forums Shell Programming and Scripting Script to validate header in a csv file Post 303018874 by RudiC on Monday 18th of June 2018 04:12:04 AM
Old 06-18-2018
How about

Code:
if awk '{exit !(/TRX #\tTYPE\tREF #/)}' $file_name
   then	# process file
   else	exit 1
   fi

What's the difference between $name and $file_name?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

validate csv file load

Hi All, I am using sqlldr to load my csv files into the database. The code in the sh script is as follows. sqlldr ${DBUSER}/${DBPASS}@${ORACLE_SID} \ data=myCSV.data \ bad=myCSV.bad \ control=myCSV.ctl \ ... (0 Replies)
Discussion started by: rahulrathod
0 Replies

2. Shell Programming and Scripting

How to validate a CSV file?

Hi. I think some people have already asked this, but the answers/questions seem to be about validating the contents inside a CSV file. I am simply after a simple variable solution (ie 0 = false, 1 = true) that I can use in my script to say that file so-and-so is actually a CSV file, or in some... (4 Replies)
Discussion started by: ElCaito
4 Replies

3. Shell Programming and Scripting

How can I add a header to a csv file

I have a csv file which has no header. the file has 15 fields and needs to go out with a header of 8 fields. The header content needs to have some variables and some fixed that i have set up: variable header fields OUTFILE_YEAR=`date '+%y'` DATE=`date '+%d%m%y'` TIME=`date '+%H:%M:%S'`... (6 Replies)
Discussion started by: Pablo_beezo
6 Replies

4. Shell Programming and Scripting

How to: Validate a CSV file using an XSD?

Hi All, I was wondering if there is a utility/perl library/way of validating the contents of a CSV file using an XSD. i.e. Customer csv (including Header & Trailer) Cust_num, Cust_nme, Cust_typ, Cust_act_dte, Cust_loc, 101,Joe's Pizza,Retail,10121979,Detroit, 102,Sony... (6 Replies)
Discussion started by: luinzi
6 Replies

5. UNIX for Dummies Questions & Answers

Merge all csv files in one folder considering only 1 header row and ignoring header of all others

Friends, I need help with the following in UNIX. Merge all csv files in one folder considering only 1 header row and ignoring header of all other files. FYI - All files are in same format and contains same headers. Thank you (4 Replies)
Discussion started by: Shiny_Roy
4 Replies

6. Shell Programming and Scripting

Script to validate file header and trailer

Hi, I need a script that validates a file header/detail/trailer. File layout is: Header - Rec_Type|File_name|File_Date Detail - Rec_Type|field1|field2|field3... Trailder - Rec_Type|File_name|File_Date|Record_count Sample Data: HDR|customer_data.dat|20120709... (7 Replies)
Discussion started by: ash_sh
7 Replies

7. Shell Programming and Scripting

Exclude the header row in the file to validate

Hi All, File contains header row.. we need to exclude the header row...no need to validate the first row in the file. Data in the file should take valid data(two columns)..we need to exclude the more than two columns in the file except the first line. email|firstname a|123|100 b|345... (4 Replies)
Discussion started by: bmk
4 Replies

8. Shell Programming and Scripting

Script to ingest a csv, validate data and insert into Oracle

Hi all i would appreciate your help... I am looking for a set of unix commands which i can use to 1) ingest a csv file with a known format 2) validate the filename 3) validate the data/datatypes 4) Insert into an oracle db Can you help get me started? yogz888 (1 Reply)
Discussion started by: yogz888
1 Replies

9. UNIX for Beginners Questions & Answers

Validate csv file

Hi guys, i want to validate the no.of colums in a csv file ,but if there is a comma(,) in any of the data values it should skip and count only valid (,) commas. e.g 1.abc,pqrs,1234,567,hhh result :4 2.abc,pqrs,1234,567,hhh,"in,valid",end12 result:6 here script should skip the comma inside... (10 Replies)
Discussion started by: harry123
10 Replies

10. Shell Programming and Scripting

Bash to verify and validate file header and data type

The below bash is a file validation check executed that will verify the correct header count of 10 and the correct data type in each field of the tab-delimited file. The key has the data type of each field in it. My real data has 58 headers in it but only the header and next row need to be... (6 Replies)
Discussion started by: cmccabe
6 Replies
__gnu_parallel::QSBThreadLocal< RandomAccessIterator >(3cxx)			      __gnu_parallel::QSBThreadLocal< RandomAccessIterator >(3cxx)

NAME
__gnu_parallel::QSBThreadLocal< RandomAccessIterator > - SYNOPSIS
Public Types typedef traits_type::difference_type difference_type" typedef std::pair < RandomAccessIterator, RandomAccessIterator > Piece" typedef std::iterator_traits < RandomAccessIterator > traits_type" Public Member Functions QSBThreadLocal (int queue_size) Public Attributes volatile difference_type * elements_leftover Piece global Piece initial RestrictedBoundedConcurrentQueue < Piece > leftover_parts" thread_index_t num_threads Detailed Description template<typename RandomAccessIterator>struct __gnu_parallel::QSBThreadLocal< RandomAccessIterator > Information local to one thread in the parallel quicksort run. Definition at line 62 of file balanced_quicksort.h. Member Typedef Documentation template<typename RandomAccessIterator> typedef std::pair<RandomAccessIterator, RandomAccessIterator> __gnu_parallel::QSBThreadLocal< RandomAccessIterator >::Piece Continuous part of the sequence, described by an iterator pair. Definition at line 69 of file balanced_quicksort.h. Constructor &; Destructor Documentation template<typename RandomAccessIterator> __gnu_parallel::QSBThreadLocal< RandomAccessIterator >::QSBThreadLocal (intqueue_size) [inline] Constructor. Parameters: queue_size Size of the work-stealing queue. Definition at line 88 of file balanced_quicksort.h. Member Data Documentation template<typename RandomAccessIterator> volatile difference_type* __gnu_parallel::QSBThreadLocal< RandomAccessIterator >::elements_leftover Pointer to a counter of elements left over to sort. Definition at line 81 of file balanced_quicksort.h. Referenced by __gnu_parallel::parallel_sort_qsb(), __gnu_parallel::qsb_conquer(), and __gnu_parallel::qsb_local_sort_with_helping(). template<typename RandomAccessIterator> Piece __gnu_parallel::QSBThreadLocal< RandomAccessIterator >::global The complete sequence to sort. Definition at line 84 of file balanced_quicksort.h. template<typename RandomAccessIterator> Piece __gnu_parallel::QSBThreadLocal< RandomAccessIterator >::initial Initial piece to work on. Definition at line 72 of file balanced_quicksort.h. Referenced by __gnu_parallel::qsb_conquer(), and __gnu_parallel::qsb_local_sort_with_helping(). template<typename RandomAccessIterator> RestrictedBoundedConcurrentQueue<Piece> __gnu_parallel::QSBThreadLocal< RandomAccessIterator >::leftover_parts Work-stealing queue. Definition at line 75 of file balanced_quicksort.h. Referenced by __gnu_parallel::qsb_local_sort_with_helping(). template<typename RandomAccessIterator> thread_index_t __gnu_parallel::QSBThreadLocal< RandomAccessIterator >::num_threads Number of threads involved in this algorithm. Definition at line 78 of file balanced_quicksort.h. Referenced by __gnu_parallel::qsb_local_sort_with_helping(). Author Generated automatically by Doxygen for libstdc++ from the source code. libstdc++ Thu Aug 2 2012 __gnu_parallel::QSBThreadLocal< RandomAccessIterator >(3cxx)
All times are GMT -4. The time now is 02:52 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy