Why Maximum Field Length in Views Module(drupal) doesnt changes the view? - drupal-6

The "Trim this field to a maximum length" option is giving me some pretty unexpected and confusing results. I have decided I want my field length to be cut
off after 35 characters. However when I specify this amount in the "Maximum Length" text box and save the view, the field is completely cut off, everything
is gone.
So as a test I raised the limit to 100 characters, this gave me some of the field. However I don't know where Views is getting the 100 characters from?
What does it consider a character to be?
The next issue is that I have many fields in my grid (in a descending order), and the 100 characters limit I've set is behaving differently on each field.
I would expect all the fields to be the same length, however some are drastically shorter than others.
I can't get my head around this at all! Help?!

Can the field have html code? If so, it may examplain your issue.
This trim tool counts all characters, be it html code or the text to display.
Best option for you might be to mark the option below trim checkbox.
Remove HTML tags

Related

Replace specific characters in a paragraph of text based on its numbered position with randomly generated characters

I've dabbled a bit with JavaScript years ago but I couldn't quite grasp the logic behind it. I still have some understanding of the basics but not enough to achieve what I'd like to. I don't have the time to research how to write the code myself, but if you could point me to already-coded, individual functions which achieve the results I'm looking for, perhaps I could play around with them and then ask for further help after that when needed.
I've got a paragraph of text (It could be anything) about 300 characters long, including spaces, capitalization, and punctuation. I would like a function which generates a random number based on the length of characters in the paragraph, i.e. the function counts the number of characters such that the generated number would never be higher than the number of characters in the paragraph) and then replaces that character with a randomly generated character based on a list of characters which appear in the paragraph (e.g. a-z,A-Z,and punctuation).
For example, if the number generated is 34, then the 34th character (whatever it may be) will be replaced by whatever character is randomly generated.
And finally, a function to input how many times this process should repeat, e.g. 10 times, 100 times, etc. before stopping, and one can view how the resulting paragraph of text has changed.
Any suggestions will be appreciated. Thanks.
Sorry, I've not tried anything yet as I'd like to get advice, first.

How to extract string value based on delimiters

I need help with an Excel formula to extract a value from a string, based on delimiters.
This is the string I would like to extract the first 10 fields from: ES_ABC_FACEBOOK_SocialImage_FACEBOOK_Reach(CPM)_DEM_18-45_Apr19_abc_def_ghi
In other words, I would need to get ES_ABC_FACEBOOK_SocialImage_FACEBOOK_Reach(CPM)_DEM_18-45_Apr19_abc
Bearing in mind that the number of fields (separated by delimiters) may vary in the dataset but that I need to consistently only pick up the first 10 fields and drop however many fields are succeeding the 10th field.
Thanks in advance!
Robin
You could try this:
=LEFT(<your cell>,FIND("||",SUBSTITUTE(<your cell>,"_","||",10))-1)
e.g. =LEFT(A1,FIND("||",SUBSTITUTE(A1,"_","||",10))-1)
The formula finds the 10th underscore, and the gives you all the characters up to it (minus the underscore).
If you need to change how many fields it gives you back, change the 10. The -1 at the end just removes the final underscore. Of note, the || is just a simple set of characters I can't imagine will ever appear in your strings. If it does, something else will need to be selected.
Lastly, if some of your strings will have less than 10 fields, try:
=IF(ISERROR(FIND("||",SUBSTITUTE(<your cell>,"_","||",10))-1),<your cell>,LEFT(<your cell>,FIND("||",SUBSTITUTE(<your cell>,"_","||",10))-1))
This gives you the whole string in the event that there are less than 10 fields.
Hope that helps.

Concat fields without fixed lenght in Pentaho Kettle?

I have two string fields of unspecified length, lets call them One and Two. Now I would like to concat them, so that if One = "aaa" and Two = "bbb" the result becomes "aaabbb". Using the Concat fields step seems like a reasonable first guess for how to do this.
However, if I leave the "Length of target field" setting with the standard value of 0 I get no output. If I set it to something large, like 100, I always get extra spaces at the end. I want the resulting field to be as long as necessary to contain One + Two, not longer and not shorter. Is there anyway to do this using this step or some other one?
I have tried using the trim setting, but it trims the input and not the output. Clicking the "Minimal width" button does absolutely nothing.
This seems like it should be a pretty simple standard task. Am I missing something here?
EDIT: My input here is just a few rows from a Data grid step, without anything between the grid and the concat. I tried replacing the grid with a Generate rows step, but I get the same result (both when using fixed length for the generated fields, and when leaving the length fields blank).
My version of Kettle is 5.4.0.1-130. I am running it on a Windows 7 x64 platform.
Do the configuration as shown in the figure. It correctly gives the result as the second figure.
Result:
Used Data Grid step to get data.
The configuration suggested by Marlon Abeykoon works. It also works with type "String" instead of "None".
My problem was not in the Concat fields step, but the Text file output step I used to write the result to a file. It takes its metadata about the fields from the Concat fields step, and inherits the zero length for the field therefore printing zero characters to the text file.
The solution is to go to the "Fields" tab of the output step, and there press "Get fields". That explicitly adds all the fields and their metadata to the list, so you can change the lenght field of the output field from the concat step to be empty instead of 0.

Replace colon with tab to make columns

I have word lists where the word or expression in Spanish is separated by its translation with a colon (":"). I want to make two columns, one for Spanish, the other for English. In vim I tried with
:%s/:/^I^I^I/g
But it does not give the desired output. The different columns are not aligned.
When deleting the colon by hand and inserting the number of tabs with the same amount of tab strokes, it always ends up aligned.
Any idea how to solve this, preferably in vim?
On a Linux/*nix system I use column(1)
:%!column -s':' -t
followed by
:%retab!
I'd probable do a
:s/:/^I/g
followed by a
:set ts=25
Where 25 is the length of the longest word expected + 2. So, if you expect the longest word of your input (on the left side of the colon) to be 12 characters, I'd choose something around 14 instead.
With Tabular.vim it's quite easy, just type :Tab /:\zs and it does the rest.
When in insert mode a setting of yours makes tab to reach a nth column. This is set with the 'softtabstop' settings if I am right.
For those tasks you could use a plugin like Align.vim or Tabularize.
Another option is to insert a huge number of spaces, and then use Visual Block with < operator as many times as necessary, if you have to do it once. Otherwise prefer reusable methods.

Excel Comments - Max Length in 2003

Anybody know what the limit is for the comments on an Excel cell (2003)? I'm programatically filling this in and want to make sure that I don't exceed the limit.
This page list all the Excel specifications and limits.
Not sure about comments, but it seems cell data is limited to 32767 characters. Also not sure of the character encoding or if that matters.
Looked up the BIFF specification for NOTES (which are actually cell comments) and there is not a limit per se, only 2048 per NOTES record, but you can have as many of these as you like, they are marked as continuation records past the first one. With this in mind, it seems limitless.
However, to be safe, I'm cutting mine at 15,000 (as we should never need more than a 1000 for what we are doing).
I just tried to give it a try by putting large comment programatically.
And I ended with result : 22877 chars. However I'm not sure whether character encoding matters.
According to "Excel specifications and limits" the the max number of chars is 32767 (only 1024 display in a cell).
I suspect that's characters on the assumption that no character ever takes more than 2 bytes...

Resources