In EmEditor, how to normalize multiple consecutive whitespaces to 1 in multi-column file - emeditor

When I search for \s\s+ to replace with “ “, lines in column 1 and 2 get concatenated, unless text line in column 1 ends in punctuation mark. Please provide expression to normalize whitespaces w/o losing multi-column data structure.

That's because the file is TAB-separated, and \s includes TABs. If you are interested in only spaces, please use + or {2,} instead.

Related

Does a single column CSV file have commas?

When i open my csv file in an excel it looks like this -
Header
Value1
Value2
Value3
Value4
Value5
I want to know whether this file actually has commas in it? I am aware that if i have multiple columns i will see the commas
You can easily test that by opening the file in a text editor (e.g. Notepad on Windows). It will show the file as it is in text format, i.e., with commas present (if they are in the file). I would say that if it is single column, it won't have commas (but rather line breaks between the rows), but if you need to be sure just open it with a text editor.
https://www.ietf.org/rfc/rfc4180.txt
Given there is only one value in each record it would not have a comma given the spec.
Within the header and each record, there may be one or more
fields, separated by commas. Each line should contain the same
number of fields throughout the file. Spaces are considered part
of a field and should not be ignored. The last field in the
record must not be followed by a comma. For example:

Text Fields Acceptable in SQL Loader

Are there any reserved text characters in SQL Loader ?
Any special characters like &,_" etc which cannot be loaded in Oracle table columns ?
My file column seperator is a pipe {|} character and I will escape to accept this too in my text columns but are there any other reserved characters which I cannot use in the data fields to be interfaced ?
There are none, as far as I can tell.
However, I'd suggest you to choose delimiters wisely because if text you're loading contains delimiters, you'll have problems in figuring out whether e.g. a pipe sign is a delimiter, or part of text to be loaded.
If you can prepare input data so that values are optionally enclosed into double quotes, you'd be able to avoid such problems. However, why having it complicated if it can be simple?

SSRS - Sort by number part of string

I have an SSRS report that will be used in Dynamics 365 so I can't use SQL in the dataset to help here.
I have a product/version code column that is string mixing letters and numbers. For example:
FF8,
FF9,
FF10,
FFA
These are going in to a column header and form a column group which is also sorted by the code. The standard alphabetical sorting is giving this order:
FF10 - FF8 - FF9 - FFA
I'm happy to use a substring in my sort expression to remove a preceding product code but I would like the numbers in ascending numerical format followed by text versions alphabetically:
FF8 - FF9 - FF10 - FFA
I would add a calculated column to your dataset that strips the non-numeric characters and converts to a number. This would make it easier to sort
A formula like this might help
=System.Text.RegularExpressions.Regex.Replace(Fields!productcode.Value, "[^0-9]", "")
The ^ symbol means "not" so this Regex expression will remove all characters that are not in the range of 0 to 9 (i.e. all non-numeric characters)
According to this, Regex.Replace should be supported in CRM's sandboxed reports
You also could use expression like below in Sort
=switch(Fields!name.Value="FF10",3,Fields!name.Value="FF9",2,Fields!name.Value="FF8",1,Fields!name.Value="FFA",4)
Zoe

Send a Flat file attachment in the workflow in Informatica Developer

In a mapping we use delimited flat file having 3 columns.The column separated through comma. But i have a requirement that in between the column there is a column having 2 comma.So how should I process the column in the mapping?
You should have information quoted with "" so whatever is within " is skiped. this way you could differentiate between comma of a piece of information or as a column separator.
We don't know what have you tried, but count the number of commas for each line and separate accordingly (if possible).

Reading Text file with fixed length columns using spring batch

I need to read a text file using spring batch process and bellow is a sample file
000115989 AB0001 BC00012 030114 010100 WITHDRAWL FROM SAVING 100.00
It doesn't have any column header and each column has a fixed length and delimited by two blank spaces.
Here I can't use DelimitedLineTokenizer for two blank spaces as columns can also have leading or trailing blank spaces .
Is there any work around so that I read each column with its specific length after that I can trim that.
Take a look at the FixedLengthTokenizer (http://docs.spring.io/spring-batch/trunk/apidocs/org/springframework/batch/item/file/transform/FixedLengthTokenizer.html). This allows you to set how lines are parsed by column instead of by delimiter.

Resources