oil sunflowerse tonn march said tender import trader egypt may
than you will get the following String Array:
{"oil", "sunflowerse", "tonn", "march", "said", "tender", "import", "trader", "egypt", "may"}
by using this sed script:
sed 's/^ *//; s/ *$//; s/ \{1,\}/ /g; s/ /\", \"/g; s/^/{"/; s/$/"}/' filenameIt performs this tasks:
- Remove all multiple spaces at the start
- Remove all multiple spaces at the end
- Remove all multiple spaces between the words
- Replace all single spaces with ", "
- Add {" at the start
- Add "} at the end
No comments:
Post a Comment