Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Need tips on file manipulation Post 302364472 by Scott on Friday 23rd of October 2009 07:34:04 AM
Old 10-23-2009
Hi.

Could you please post a sample of data that reflects your requirement?

Otherwise, this makes assumptions:
Code:
awk '/^[0-9]{8}/ FS { print > FILENAME "_invoice_" $1}' input_file

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

File manipulation

I'm new to Unix and want to know if this type of file processing is feasible. I have a master file downloaded on Sundays. From Monday to Saturday a file containing changes and adds and a file containing deletes are downloaded. I'd like to apply the mon-sat files to the master file so that I do not... (3 Replies)
Discussion started by: ssp7423
3 Replies

2. Shell Programming and Scripting

File manipulation

To all Guru I have a file like test.txt 111,122,212,123 data11,date12, data13, data14...data1n data21,date22, data23, data24...data2n data31,date32, data33, data34...data3n ... ... .. datan1,daten2, datan3, datan4...datann END I have to load this data into oracle , where first... (1 Reply)
Discussion started by: u263066
1 Replies

3. Shell Programming and Scripting

file manipulation

Hi, I have a file with 3 lines like aaaabb abcdef wertyu now i want to insert a new character "Q" in the 3rd position of every line of the file.... I found a way to do it but i felt it is little complex. Do you guys have any ideas (4 Replies)
Discussion started by: siddu_chittari
4 Replies

4. Shell Programming and Scripting

File Manipulation

Hi, i have a file with fixed record length with the following content (only one sentence) 12345678901234567890123456789012345678901234567890 12345678 87654321 hugo meyer friedhofpaul the numbers above are only the column-positions and not part of the file! Now i want... (2 Replies)
Discussion started by: FranzB
2 Replies

5. Shell Programming and Scripting

File manipulation

Hello, I have a file of which six lines are given below: <a="b" value="N"/> <a="c" value="x1"/> <a="b" value="N"/> <a="c" value="x2"/> <a="b" value="Y"/> <a="c" value="x3"/> I need one file with all the lines just below where value="N"... (4 Replies)
Discussion started by: shekhar2010us
4 Replies

6. UNIX for Dummies Questions & Answers

file manipulation

Is there a way to cp/mv a set of files in a directory + sub directories without cp/mv'ing the sub-directories as well? eg. To copy all the *.pdf files in a directory + sub directory into a specified folder i would invoke " cp -R *.pdf ~/Home/ however, this would copy the subdirectories as... (4 Replies)
Discussion started by: grkness
4 Replies

7. UNIX for Dummies Questions & Answers

Filtering records from 1 file based on some manipulation doen on second file

Hi, I am looking for an awk script which should help me to meet the following requirement: File1 has records in following format INF: FAILEd RECORD AB1234 INF: FAILEd RECORD PQ1145 INF: FAILEd RECORD AB3215 INF: FAILEd RECORD AB6114 ............................ (2 Replies)
Discussion started by: mintu41
2 Replies

8. Shell Programming and Scripting

Awk to convert a text file to CSV file with some string manipulation

Hi , I have a simple text file with contents as below: 12345678900 971,76 4234560890 22345678900 5971,72 5234560990 32345678900 71,12 6234560190 the new csv-file should be like: Column1;Column2;Column3;Column4;Column5 123456;78900;971,76;423456;0890... (9 Replies)
Discussion started by: FreddyDaKing
9 Replies

9. Shell Programming and Scripting

Populating File data with custom manipulation on file names

Hi, I am confused how to proceed firther please find the problem below: Input Files: DCIA_GEOG_DATA_OCEAN.TXT DCIA_GEOG_DATA_MCRO.TXT DCIA_GEOG_DATA_CVAS.TXT DCIA_GEOG_DATA_MCR.TXT Output File Name: MMA_RFC_GEOG_NAM_DIM_LOD.txt Sample Record(DCIA_GEOG_DATA_OCEAN.TXT):(Layout same for... (4 Replies)
Discussion started by: Arun Mishra
4 Replies

10. Shell Programming and Scripting

File manipulation

Hi, I want to update the file with a value at a particular position $cat test.txt COL1=TEST COL2= COL3=AADSDFSDFDSFDFDF I want to update the file with a value for COL2. After update, the file should be like this $cat test.txt COL1=TEST COL2=1 COL3=AADSDFSDFDSFDFDF here 1... (9 Replies)
Discussion started by: vedanta
9 Replies
LedgerSMB::DBObject::Company(3pm)			User Contributed Perl Documentation			 LedgerSMB::DBObject::Company(3pm)

NAME
LedgerSMB::DBObject::Company - Base utility functions for processing customers and vendors. SYNOPSIS
This library contains the base utility functions for creating, saving, and retrieving customers and vendors. METHODS
$company->set_entity_class() This is a stub for a private method that subclasses are expected to overwrite. It will be set to the account class of the entity (1 for vendor, 2 for customer, etc). get_by_cc This retrieves the company header information by control code. Leaves the overall account class untouched. save() This stores the company record including a credit account in the database. TODO: Separate company from credit account storage. delete_contact required request variables: contact_class_id: int id of contact class contact: text of contact information Must include at least one of: credit_id: int of entity_credit_account.id, preferred value company_id: int of company.id, only used if credit_id not set. returns true of a record was deleted. delete_location Deletes a record from the location side. Required request variables: location_id location_class_id One of: credit_id (preferred) company_id (as fallback) Returns true if a record was deleted. False otherwise. delete_bank_account Deletes a bank account Requires: entity_id bank_account_id Returns true if a record was deleted, false otherwise. get_history Retrieves customer/vendor purchase. Search Criteria name: search string for company name contact_info: Search string for contact info, can match phone, fax, or email. salesperson: Search string for employee name in the salesperson field notes: Notes search. Not currently implemented meta_number: Exact match for customer/vendor number address_line: Search string for first or second line of address. city: Search string for city name state: Case insensitive, otherwise exact match for state or province zip: leading match for zip/mail code country_id: integer for country id. Exact match tartdate_from: Earliest date for startdate of entity credit account startdate_to: Lates date for entity credit accounts' start date type: either 'i' for invoice, 'o' for orders, 'q' for quotations from_date: Earliest date for the invoice/order to_date: Latest date for the invoice/order Unless otherwise noted, partial matches are sufficient. Control variables: inc_open: Include open invoices/orders. If not true, no open invoices are displayed inc_closed: Include closed invoices/orders. If not true, no closed invoices are displayed report_type: Either summary or detail returns a list of rows of the summary report and sets these to @{$self->{history_rows}} save_credit This method saves the credit account for the company. Expected inputs: credit_id (int): (Optional) Id for the account entity_class (int): Class of the account, required (1 = vendor, 2 = customer) entity_id (int): ID of entity to attach to. description (text): Description of account discount (numeric): Early payment discount taxincluded (bool): Whether prices include tax. creditlimit (numeric): Credit limit discount_terms (int): How many days can elapse before the discount lapses too. terms (int): How many days can lapse before the invoice is overdue. meta_number (varchar): Account string identifier for the account. business_id (int): ID for business type. language (varchar): Language code for invoices. pricegroup_id (int): Price group curr (char): Currency identifier, three characters long. startdate (date): Date of the start of the relationship. enddate (date): Date of the end of the relationship. threshold (NUMERIC): How much must be owed before the invoices can be paid. ar_ap_account_id (int): ID of ar/ap account. REQUIRED cash_account_id (int): ID of cash account (Optional) pay_to_name (text): Name to pay to or receive from. taxform_id (int); ID of tax form save_location This method saves an address for a company. Requires the following variables on the object: credit_id location_id location_class (1 = billing, 2 = shipping, 3 = sales) line_one line_two city state (can hold province info) mail_code (zip or postal code) country_code (ID of country) get_credit_id This method returns the current credit id from the screen. Requires entity_id, meta_number, and entity_class be set. get_metadata() This retrieves various information vor building the user interface. Among other things, it sets the following properties: $self->{ar_ap_acc_list} = qw(list of ar or ap accounts) $self->{cash_acc_list} = qw(list of cash accounts) $self->{entity_classes} = qw(list of entity classes) $self->{all_taxes} =qw(list of taxes) save_contact Saves a contact. Requires credit_id, contact_class, description, and contact to be set. Requires the following be set: credit_id or entity_id contact_class description contact old_contact old_contact_class save_bank_account Saves a bank account. Requires the following be set: entity_id bic (bank id) iban (account number) bank_account_id (id for record, optional) save_notes Saves notes. The following must be set: credit_id: credit account to annotate. Must be set to annotate credit account entity_id: entitity to annotate. note: Note contents subject: Note subject search Searches for matching company records. Populates $self->{search_results} with records found. Search criteria and inputs: account_class: required (1 for vendor, 2 for customer, etc) contact contact_info meta_number address city state mail_code country date_from date_to business_id legal_name control_code Account class may not be undef. meta_number is an exact match, as is control_code. All others specify ranges or partial matches. get_billing_info Requires that the id field is set. Sets the following: legal_name meta_number control_code tax_id street1 street2 street3 city state mail_code country accounts Returns all accounts, and sets these to $self->{accounts}. id and entity_class must be set. address($id) Returns the location if it is specified by the $id argument. get Retrieves a company record and all info. taxform_list is set to a list of tax forms for the entity's country credit_list is set to a list of credit accounts locations is set to a list of locations contacts to a list of contacts notes to a list of notes bank_account to a list of bank accounts get_pricematrix This routine gets the price matrix for the customer or vendor. The pricematrix info is stored in the pricematrix hash entry. If a customer (account_class=1), it also populates a pricematrix_pricegroup entry. delete_pricematrix($entry_id) This deletes a pricematrix line identified by $entry_id save_pricematrix Updates or inserts the price matrix. COPYRIGHT
Copyright (c) 2009, the LedgerSMB Core Team. This is licensed under the GNU General Public License, version 2, or at your option any later version. Please see the accompanying License.txt for more information. perl v5.14.2 2012-03-25 LedgerSMB::DBObject::Company(3pm)
All times are GMT -4. The time now is 10:54 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy