![]() |
Ciao e benvenuto da parte degli Stati Uniti al UNIX e Linux Forum! Grazie per la visita ed unirsi alla nostra Comunità Globale.
|
|
google unix.com
|
|||||||
| Forum | Registrati | Regole Forum | Collegamenti | Album | FAQ | Members List | Calendario | Ricerca | Today's Posts | Mark Forums Read |
| Shell scripting e di programmazione Pubblica domande su KSH, CSH, SH, Bash, Perl, PHP, sed, awk e da altri script di shell e linguaggi di scripting shell qui. |
Più di UNIX e Linux Forum Argomenti potreste trovare utili
|
||||
| Filo | Thread Starter | Forum | Risposte | Ultimo Post |
| fusione di due file | vakharia Mahesh | Shell scripting e di programmazione | 7 | 09-15-2008 12:32 PM |
| La fusione di array | jakSun8 | Shell scripting e di programmazione | 4 | 07-01-2008 11:13 PM |
| Unire due file | venommaker | UNIX for Dummies Domande & Risposte | 4 | 01-10-2008 08:15 AM |
| Fondere info | Manan | Shell scripting e di programmazione | 3 | 05-20-2006 07:51 AM |
| Fondere Aiuto | kumarc | Shell scripting e di programmazione | 3 | 05-04-2006 02:24 PM |
![]() |
|
|
LinkBack | Thread Tools | Cerca in questo Thread | Rate Thread | Modalità di visualizzazione |
|
|
|
||||
|
Fusione delle righe
Ciao ragazzi,
Auguriamo tutti un Felice Anno Nuovo!. Grazie in anticipo. Voglio leggere un file e unire le righe che hanno un '\ n' in esso. Il file potrebbe essere> 50.000 byte. Lo script dovrebbe unire tutte le righe fino alla riga successiva inizia con la parola 'Tipo |'. ex. Tipo | Ticket | TradeID | 42224A | SystemID | DDDD61266 | SourceSystem | RMS | Version | 5 | LatestVersionYN | Y | Counterpa rty | OB | DBLegalEntity | Londra | Note | cal eventi aggiunto | venditore | DHX | LastUpdated | dic 2008 18:31 : 40 | Azione | Exp | DealCaptureSystem | Vendite | CustomerSourceSystem | RMS | Servizio Clienti | AUGS | ActionEffectiveDa te | DEC 2008 00:00:00 | BookingLocation | Londra | EnteredBy | GONU | MarkupAmt | 100 | MarkupCcy | KEX | PremiumCurrency | EUR | Premi umAmount | 000 | PremiumDate | dic 2008 | PremiumHasPaidYN | N | BookingDetails | 9000/mihl Cliente vende KEZUSD rif st 1,3724 Leveraged Sele è ST 52 Sele, a partire Tipo | FxDiscreteDNT | TradeID | SSA32553H | SystemID | GGT04481 | SourceSystem | RMS | SourceSystemBook | OT | Prenotare | OT | BookBranchParent | Vai | Version | 8 | LatestVersionYN | Y | Controparte | DOB | Stato | KnockedOut | IsLiveYN | N | DBLega lEntity | Londra | LastUpdated | GEN 2009 00:26:35 | Azione | KnockedOut | CounterpartySourcesystem | RMS | TradeDate | lug 2006 | ProductID | KKI99106 | StructureID | DDS32553 | DealCaptureSystem | RMS | CustomerSourceSystem | RMS | Servizio Clienti | APS | PricingSite | Opzioni | UnderCurrency1 | JPY | AccCurrency1 | US | UpBarrier1 | 1,5 | LowBarrier1 | 1 | UnderCurrenc y2 | JPY | AccCurrency2 | CH | UpBarrier2 | 1,64 | LowBarrier2 | 1,49 | UnderCurrency3 | EUR | AccCurrency3 | JPY | UpBarrie r3 | 175 | LowBarrier3 | 105 | LastFixed Il outout dovrebbe essere La registrazione che dovrebbe essere al di sotto di una sola riga. Tipo | Ticket | TradeID | 42224A | SystemID | DDDD61266 | SourceSystem | RMS | Version | 5 | LatestVersionYN | Y | Counterpa rty | OB | DBLegalEntity | Londra | Note | cal eventi aggiunto | venditore | DHX | LastUpdated | dic 2008 18:31 : 40 | Azione | Exp | DealCaptureSystem | Vendite | CustomerSourceSystem | RMS | Servizio Clienti | AUGS | ActionEffectiveDa te | DEC 2008 00:00:00 | BookingLocation | Londra | EnteredBy | GONU | MarkupAmt | 100 | MarkupCcy | KEX | PremiumCurrency | EUR | Premi umAmount | 000 | PremiumDate | dic 2008 | PremiumHasPaidYN | N | BookingDetails | 9000/mihl Cliente vende KEZUSD ° rif 1,3724 Leveraged Sele si trova a 52 ST Sele, a partire Tipo | FxDiscreteDNT | TradeID | SSA32553H | SystemID | GGT04481 | SourceSystem | RMS | Version | 8 | LatestVersionYN | Y | Controparte | DOB | DBLegalEntity | Londra | LastUpdated | GEN 2009 00:26:35 | Azione | KnockedOut | DealCaptureSystem | RMS | CustomerSourceSystem | RMS | Servizio Clienti | APS | PricingSite | O ption | UnderCurrency1 | JPY | AccCurrency1 | US | UnderCurrency3 | EUR | AccCurrency3 | JPY | UpBarrier3 | 175 | LowBarri er3 | 105 | LastFixed Ho provato a utilizzare lo script qui di seguito menzionati, ma non può gestire AWK> 20.000 byte. Inoltre, utilizzando come stringa 'LINE_BREAK' per identificare le righe si è fusa. FileName \u003d LINE_TEST.TXT Nomefile1 \u003d O_LINE_TEST.TXT File_output \u003d OUTPUT_WITHOUT_LINE_BREAK.tmp if [[-e $ filename]], quindi sed "s /% / percentuale / g" $ filename> $ nomefile1 # # Per rimuovere '%', come 'awk' non può gestire la cosa. / usr/xpg4/bin/awk 'NR \u003d\u003d 1 (printf $ 0;) accanto ! / ^ TradeType / (printf "LINE_BREAK" $ 0;) accanto (printf "\ n" $ 0) END (print "") '$ Nomefile1> $ file_output fi |
![]() |
| Segnalibri |
| Thread Tools | Cerca in questo Thread |
| Modalità di visualizzazione | Vota questo thread |
|
|