vim regex search csv string and paste matches -
edit:
I search with regex in Vim and remove any match Good way
I have a CSV file that looks like this:
Two fields:
-
ID
-
Description
0g98932 , "Longer details sometimes have numbers like 1234567, or 0000012345 and even BR00012345 but always with text"
The search field must be searched. If there is a \ d {10} matching number in the second area, then I want to draw it
do something like :% s / ($ 1 / g) gives me one
Pattern not found (\ D {10}) error
I have never learned how to grab a match from a regex search in Vim and reference - so that the problem is part of it.
Other Part:
I would really like either.
- Delete everything except the first 7 digits id and matches
- ID and match any other file - or at the top of the current file (somewhere - somewhere, to separate matches from filtered data). The important thing to know about
to : help / \ m
: \ v \ m \ M \ The 'magic' nominal '$$$' match from the matches matches the line of the end. \. \. Match any character * * * * * In any number, the last atom () \ (\) \ (\) \ (\) is grouped into an atom. \ | \ | \ | Different option \ a \ a \ a \ alphabetical character \\ \\ \\ \\ literal backslash. \. . . The literal dot \ {{literal '{' aaaa literal 'a' The default setting is 'magic', so to create the regex that you worked on, you have to use it :
:% s / ". * \ (\ D \ {10} \). *" / <1 / if you want
: v / ^ \ ([[if you want to delete lines without any matches, by which you want to delete the lines) :: alnum:]] \ {7} \), \ s * ". * \ (\ D \ {10} \). * / D:% s // \ 1, \ 2 / : v / : s // Reuse the previous pattern , So we do not need to specify it.
It converts the following:
0g98932, numbers 0123456789 "0g98 9 32," Long Description Number "0g98932", "Long Description No Numbers" 0g98932, "Long Description No Longer No description "0g98932", "No details from long time" 0g 9 832, "long details no numbers" 0g 9 8 9 32, "long details like" 0123456789 "0g 9 8 9 32, 0g 9 8 9 32, "Long Description No Numbers" 0g 9 832, "Long Description No Number" 0g 9 832, "In the long description sometimes there are numbers like 0123456789" In:
0g 98 9 32,0123456789 0g98932,0123456789 0g98932,0123456789 0g98932,0123456789
Comments
Post a Comment