Suppose I have the following strings, from a file containing similar strings :
Andorra la Vella|ad|Andorra la Vella|20430|42.51|1.51|
Canillo|ad|Canillo|3292|42.57|1.6|
Encamp|ad|Encamp|11224|42.54|1.57|
La Massana|ad|La Massana|7211|42.55|1.51|
...
How could I print the first number (or the fourth field of each string) using regular expressions? And, how could I print the first 4 fields from a particular line (e.g. "Andorra la Vella" "ad" "Andorra la Vella" 20430) if the 4th number is above 10000?