Score:0

Split text file by =

in flag

I have a bunch of .dat files (about 1000) in separate folders. each of them has some kind of data like below :

Carreau Poseuille Flow

Velocity in lattice units: u=0.00210431
Reynolds number:           Re=5.30287
Carreau number:            Cu=10
Lattice resolution:        N=252
Extent of the system:      lx=1
Extent of the system:      ly=1
Extent of the system:      lz=1
Grid spacing deltaX:       dx=0.00396825
Time step deltaT:          dt=8.35045e-06
Exponent:                  n=1
Zero viscosity:            nu0=0.1
Inf viscosity:             nuInf=0
Zero Omega:                omega0=1.25
Inf  Omega:                omegaInf=2
Lambda:                    lambda=1.19754e+06
time dependancy factor:                    TDfactor=1

I want to split this text and remove anything by the left side of = ; which means I only need numbers in a column. I appreciate any suggestion.

many thanks; Elahe

Score:1
jp flag

You can cut at = and select second column:

< input-file cut -d = -f2 > output-file

See man cut for more details about cut.

Score:1
it flag

You can cut at = and be done.

cut -d= -f 2 input_file >output_file

Read man cut.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.